From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernhard Bitsch To: development@lists.ipfire.org Subject: Aw: Re: [PATCH] Syntax fixes in several CGIs Date: Tue, 29 Dec 2020 20:52:05 +0100 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5156163881228987982==" List-Id: --===============5156163881228987982== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, > Gesendet: Dienstag, 29. Dezember 2020 um 17:51 Uhr > Von: "Matthias Fischer" > An: "Bernhard Bitsch" > 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 ha= sh tags in '. > > For example > > value=3D'$Lang::tr{'update'}' > > can read > > value=3D'$Lang::tr{update}' > > > > In most locations we use the stringifying, it is just cosmetic. Thus an o= verall 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=3D$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 th= e 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 =3D '$Lang::tr{'update'}'!? > > Stringifying =3D ??? > See above. In case of translation hash %Lang::tr many keys are composed of se= veral words, requesting the string representation 'this is a key'. The example value =3D '$Lang::tr{'update'}' could also read value =3D '$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" > >> An: development(a)lists.ipfire.org > >> Betreff: [PATCH] Syntax fixes in several CGIs > >> > >> Signed-off-by: Matthias Fischer > >> --- > >> 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...] > --===============5156163881228987982==--