public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Bernhard Bitsch <Bernhard.Bitsch@gmx.de>
To: development@lists.ipfire.org
Subject: Aw: Re:  [PATCH] Syntax fixes in several CGIs
Date: Tue, 29 Dec 2020 20:52:05 +0100	[thread overview]
Message-ID: <trinity-abc22bbb-697c-449c-99be-3467dc7b4db5-1609271525337@3c-app-gmx-bap73> (raw)
In-Reply-To: <d81d8c15-4e00-3707-4059-b1404b25b582@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 2728 bytes --]

Hi,

> Gesendet: Dienstag, 29. Dezember 2020 um 17:51 Uhr
> Von: "Matthias Fischer" <matthias.fischer(a)ipfire.org>
> An: "Bernhard Bitsch" <Bernhard.Bitsch(a)gmx.de>
> Cc: development(a)lists.ipfire.org
> Betreff: Re: Aw: [PATCH] Syntax fixes in several CGIs
>
> On 29.12.2020 14:50, Bernhard Bitsch wrote:
> > Hi,
> >
> > to avoid possible mis-interpretation by Perl we do not need to set the hash tags in '.
> > For example
> >   value='$Lang::tr{'update'}'
> > can read
> >   value='$Lang::tr{update}'
> >
> > In most locations we use the stringifying, it is just cosmetic. Thus an overall editing is not needed.
>
> Ok, thanks.
>
> I thought it was mandatory because of Michaels comment about the 'Save'
> translation in 'wlanap.cgi'. And in fact I once ran into problems using
> something like value=$Lang::tr{'Save and restart'}. This didn't work as
> expected. As Michael wrote, this was "longer than one word in one
> language". ;-) It just refused to be translated as a whole.
>

First just an excuse. I wrote 'hash tag' without thinking thoroughly about the term. ;)
I meant 'hash key'. If this key consists of just one word ( no spaces ) it is sufficient just to use this word as key.
Your example uses a string with spaces, thus you must "stringify" the key.

> But at the risk of sounding silly: I still got translation and
> designation(?) problems, sorry.
>
> Hash tag = '$Lang::tr{'update'}'!?
>
> Stringifying = ???
>

See above. In case of translation hash %Lang::tr many keys are composed of several words, requesting the string representation 'this is a key'.
The example
   value = '$Lang::tr{'update'}'
could also read
   value = '$Lang::tr{"update"}'
not using the same delimiters for the string update.
Remember, a regex automaton usually doesn't count, thus it cannot distinguish start and end delimeters. The second ' is treated as the end of the string.

Hope, this makes my suggestion a bit clearer.

Bernhard

> > Greets,
> > Bernhard
> >
> >> Gesendet: Dienstag, 29. Dezember 2020 um 13:50 Uhr
> >> Von: "Matthias Fischer" <matthias.fischer(a)ipfire.org>
> >> An: development(a)lists.ipfire.org
> >> Betreff: [PATCH] Syntax fixes in several CGIs
> >>
> >> Signed-off-by: Matthias Fischer <matthias.fischer(a)ipfire.org>
> >> ---
> >>  html/cgi-bin/asterisk/calls.cgi | 2 +-
> >>  html/cgi-bin/asterisk/conf.cgi  | 2 +-
> >>  html/cgi-bin/extrahd.cgi        | 4 ++--
> >>  html/cgi-bin/gpl.cgi            | 2 +-
> >>  html/cgi-bin/hardwaregraphs.cgi | 2 +-
> >>  html/cgi-bin/optionsfw.cgi      | 4 ++--
> >>  html/cgi-bin/upnp.cgi           | 2 +-
> >>  7 files changed, 9 insertions(+), 9 deletions(-)
> >> [Shortened...]
>

  reply	other threads:[~2020-12-29 19:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-29 12:50 Matthias Fischer
2020-12-29 13:50 ` Aw: " Bernhard Bitsch
2020-12-29 16:51   ` Matthias Fischer
2020-12-29 19:52     ` Bernhard Bitsch [this message]
2020-12-30  7:31       ` Aw: " Matthias Fischer
2020-12-30 10:44     ` Leo Hofmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-abc22bbb-697c-449c-99be-3467dc7b4db5-1609271525337@3c-app-gmx-bap73 \
    --to=bernhard.bitsch@gmx.de \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox