Signed-off-by: Matthias Fischer matthias.fischer@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(-)
diff --git a/html/cgi-bin/asterisk/calls.cgi b/html/cgi-bin/asterisk/calls.cgi index c5877b2ea..a7635f2ec 100644 --- a/html/cgi-bin/asterisk/calls.cgi +++ b/html/cgi-bin/asterisk/calls.cgi @@ -73,7 +73,7 @@ print <<END
<tr><td colspan=2>Von oder zum Anrufer mit der ID/Nummer:<td colspan=2><input type=text name=number size=20 maxlength=100 value="$cgiparams{'number'}">
-<tr><td align=center colspan=4><input type=submit name='ACTION' value=$Lang::tr{'update'}> +<tr><td align=center colspan=4><input type=submit name='ACTION' value='$Lang::tr{'update'}'> </table> END ; diff --git a/html/cgi-bin/asterisk/conf.cgi b/html/cgi-bin/asterisk/conf.cgi index 2dd8cf0a8..ab5011f21 100644 --- a/html/cgi-bin/asterisk/conf.cgi +++ b/html/cgi-bin/asterisk/conf.cgi @@ -77,7 +77,7 @@ print <<END
<tr><td align=center> <p><input type=text name=save_path value=$conf_file size=25> - <p><input type=submit name=ACTION value=$Lang::tr{'save'}> + <p><input type=submit name=ACTION value='$Lang::tr{'save'}'> </table>
END diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index da1efb2dd..aaf42baff 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -156,7 +156,7 @@ END <input type='hidden' name='DEVICE' value='$deviceline[0]' /> <input type='hidden' name='FS' value='$deviceline[1]' /> <input type='hidden' name='PATH' value='$deviceline[2]' /> - <input type='hidden' name='ACTION' value=$Lang::tr{'delete'} /> + <input type='hidden' name='ACTION' value='$Lang::tr{'delete'}' /> <input type='image' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' src='/images/delete.gif' /> </form></td></tr> END @@ -228,7 +228,7 @@ END <td align="center"> <input type='hidden' name='DEVICE' value='$partitionline[0]' /> <input type='hidden' name='UUID' value='$partitionline[2]' /> - <input type='hidden' name='ACTION' value=$Lang::tr{'add'} /> + <input type='hidden' name='ACTION' value='$Lang::tr{'add'}' /> <input type='image' alt='$Lang::tr{'add'}' title='$Lang::tr{'add'}' src='/images/add.gif' /> </form></td></tr> END diff --git a/html/cgi-bin/gpl.cgi b/html/cgi-bin/gpl.cgi index 94187ce7a..be1ea2639 100644 --- a/html/cgi-bin/gpl.cgi +++ b/html/cgi-bin/gpl.cgi @@ -71,7 +71,7 @@ print <<END; <form method='post' action='$ENV{'SCRIPT_NAME'}'> <input type='checkbox' name='gpl_accepted' value='1'/> $Lang::tr{'gpl i accept these terms and conditions'}. <br/ > - <input type='submit' name='ACTION' value=$Lang::tr{'yes'} /> + <input type='submit' name='ACTION' value='$Lang::tr{'yes'}' /> </form> </p> <a href='http://www.gnu.org/licenses/translations.html' target='_blank'>$Lang::tr{'gpl unofficial translation of the general public license v3'}</a> diff --git a/html/cgi-bin/hardwaregraphs.cgi b/html/cgi-bin/hardwaregraphs.cgi index e582acfb9..5c677d815 100644 --- a/html/cgi-bin/hardwaregraphs.cgi +++ b/html/cgi-bin/hardwaregraphs.cgi @@ -167,7 +167,7 @@ END
print <<END <tr> - <td align='center' colspan='2' ><input type='submit' name='ACTION' value=$Lang::tr{'save'} /></td> + <td align='center' colspan='2' ><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td> </tr> </table> </form> diff --git a/html/cgi-bin/optionsfw.cgi b/html/cgi-bin/optionsfw.cgi index 47aba59cb..8c996802c 100644 --- a/html/cgi-bin/optionsfw.cgi +++ b/html/cgi-bin/optionsfw.cgi @@ -323,7 +323,7 @@ END <br /> <table width='100%' cellspacing='0'> <tr><td align='right'><form method='post' action='$ENV{'SCRIPT_NAME'}'> -<input type='submit' name='ACTION' value=$Lang::tr{'save'} /> +<input type='submit' name='ACTION' value='$Lang::tr{'save'}' /> </form></td></tr> </table> </form> @@ -345,7 +345,7 @@ print <<END; <tr><td width='15%' align='left'> <select name='POLICY' style="width: 100px"> <option value='MODE1' $selected{'POLICY'}{'MODE1'}>$Lang::tr{'fwdfw pol block'}</option> <option value='MODE2' $selected{'POLICY'}{'MODE2'}>$Lang::tr{'fwdfw pol allow'}</option></select> - <input type='submit' name='ACTION' value=$Lang::tr{'save'} /><input type='hidden' name='defpol' value='1'></td> + <input type='submit' name='ACTION' value='$Lang::tr{'save'}' /><input type='hidden' name='defpol' value='1'></td> END print "</tr></table></form>"; print"<br><br>"; diff --git a/html/cgi-bin/upnp.cgi b/html/cgi-bin/upnp.cgi index 07dfa2677..5d99d0ed7 100644 --- a/html/cgi-bin/upnp.cgi +++ b/html/cgi-bin/upnp.cgi @@ -163,7 +163,7 @@ print <<END <tr><td align='left'>Downstream in KB:</td><td><input type='text' name='DOWNSTREAM' value='$upnpsettings{'DOWNSTREAM'}' size="30" /></td></tr> <tr><td align='left'>Upstream in KB:</td><td><input type='text' name='UPSTREAM' value='$upnpsettings{'UPSTREAM'}' size="30" /></td></tr> <tr><td align='left' colspan='2'><br /></td></tr> -<tr><td colspan='2' align='center'> <input type='hidden' name='ACTION' value=$Lang::tr{'save'} /> +<tr><td colspan='2' align='center'> <input type='hidden' name='ACTION' value='$Lang::tr{'save'}' /> <input type='image' alt='$Lang::tr{'save'}' title='$Lang::tr{'save'}' src='/images/floppy.gif' /></td></tr> </table></form> END
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.
Greets, Bernhard
Gesendet: Dienstag, 29. Dezember 2020 um 13:50 Uhr Von: "Matthias Fischer" matthias.fischer@ipfire.org An: development@lists.ipfire.org Betreff: [PATCH] Syntax fixes in several CGIs
Signed-off-by: Matthias Fischer matthias.fischer@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(-)
diff --git a/html/cgi-bin/asterisk/calls.cgi b/html/cgi-bin/asterisk/calls.cgi index c5877b2ea..a7635f2ec 100644 --- a/html/cgi-bin/asterisk/calls.cgi +++ b/html/cgi-bin/asterisk/calls.cgi @@ -73,7 +73,7 @@ print <<END
<tr><td colspan=2>Von oder zum Anrufer mit der ID/Nummer:<td colspan=2><input type=text name=number size=20 maxlength=100 value="$cgiparams{'number'}">
-<tr><td align=center colspan=4><input type=submit name='ACTION' value=$Lang::tr{'update'}> +<tr><td align=center colspan=4><input type=submit name='ACTION' value='$Lang::tr{'update'}'>
</table> END ; diff --git a/html/cgi-bin/asterisk/conf.cgi b/html/cgi-bin/asterisk/conf.cgi index 2dd8cf0a8..ab5011f21 100644 --- a/html/cgi-bin/asterisk/conf.cgi +++ b/html/cgi-bin/asterisk/conf.cgi @@ -77,7 +77,7 @@ print <<END
<tr><td align=center> <p><input type=text name=save_path value=$conf_file size=25> - <p><input type=submit name=ACTION value=$Lang::tr{'save'}> + <p><input type=submit name=ACTION value='$Lang::tr{'save'}'> </table>
END diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index da1efb2dd..aaf42baff 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -156,7 +156,7 @@ END <input type='hidden' name='DEVICE' value='$deviceline[0]' /> <input type='hidden' name='FS' value='$deviceline[1]' /> <input type='hidden' name='PATH' value='$deviceline[2]' />
<input type='hidden' name='ACTION' value=$Lang::tr{'delete'} />
<input type='hidden' name='ACTION' value='$Lang::tr{'delete'}' /> <input type='image' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' src='/images/delete.gif' /> </form></td></tr>
END @@ -228,7 +228,7 @@ END <td align="center"> <input type='hidden' name='DEVICE' value='$partitionline[0]' /> <input type='hidden' name='UUID' value='$partitionline[2]' />
<input type='hidden' name='ACTION' value=$Lang::tr{'add'} />
<input type='hidden' name='ACTION' value='$Lang::tr{'add'}' /> <input type='image' alt='$Lang::tr{'add'}' title='$Lang::tr{'add'}' src='/images/add.gif' /> </form></td></tr>
END diff --git a/html/cgi-bin/gpl.cgi b/html/cgi-bin/gpl.cgi index 94187ce7a..be1ea2639 100644 --- a/html/cgi-bin/gpl.cgi +++ b/html/cgi-bin/gpl.cgi @@ -71,7 +71,7 @@ print <<END; <form method='post' action='$ENV{'SCRIPT_NAME'}'> <input type='checkbox' name='gpl_accepted' value='1'/> $Lang::tr{'gpl i accept these terms and conditions'}. <br/ >
<input type='submit' name='ACTION' value=$Lang::tr{'yes'} />
<input type='submit' name='ACTION' value='$Lang::tr{'yes'}' />
</form> </p> <a href='http://www.gnu.org/licenses/translations.html' target='_blank'>$Lang::tr{'gpl unofficial translation of the general public license v3'}</a>
diff --git a/html/cgi-bin/hardwaregraphs.cgi b/html/cgi-bin/hardwaregraphs.cgi index e582acfb9..5c677d815 100644 --- a/html/cgi-bin/hardwaregraphs.cgi +++ b/html/cgi-bin/hardwaregraphs.cgi @@ -167,7 +167,7 @@ END
print <<END
<tr> - <td align='center' colspan='2' ><input type='submit' name='ACTION' value=$Lang::tr{'save'} /></td> + <td align='center' colspan='2' ><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td> </tr> </table> </form> diff --git a/html/cgi-bin/optionsfw.cgi b/html/cgi-bin/optionsfw.cgi index 47aba59cb..8c996802c 100644 --- a/html/cgi-bin/optionsfw.cgi +++ b/html/cgi-bin/optionsfw.cgi @@ -323,7 +323,7 @@ END <br /> <table width='100%' cellspacing='0'> <tr><td align='right'><form method='post' action='$ENV{'SCRIPT_NAME'}'> -<input type='submit' name='ACTION' value=$Lang::tr{'save'} /> +<input type='submit' name='ACTION' value='$Lang::tr{'save'}' /> </form></td></tr> </table> </form> @@ -345,7 +345,7 @@ print <<END; <tr><td width='15%' align='left'> <select name='POLICY' style="width: 100px"> <option value='MODE1' $selected{'POLICY'}{'MODE1'}>$Lang::tr{'fwdfw pol block'}</option> <option value='MODE2' $selected{'POLICY'}{'MODE2'}>$Lang::tr{'fwdfw pol allow'}</option></select> - <input type='submit' name='ACTION' value=$Lang::tr{'save'} /><input type='hidden' name='defpol' value='1'></td> + <input type='submit' name='ACTION' value='$Lang::tr{'save'}' /><input type='hidden' name='defpol' value='1'></td> END print "</tr></table></form>"; print"<br><br>"; diff --git a/html/cgi-bin/upnp.cgi b/html/cgi-bin/upnp.cgi index 07dfa2677..5d99d0ed7 100644 --- a/html/cgi-bin/upnp.cgi +++ b/html/cgi-bin/upnp.cgi @@ -163,7 +163,7 @@ print <<END <tr><td align='left'>Downstream in KB:</td><td><input type='text' name='DOWNSTREAM' value='$upnpsettings{'DOWNSTREAM'}' size="30" /></td></tr> <tr><td align='left'>Upstream in KB:</td><td><input type='text' name='UPSTREAM' value='$upnpsettings{'UPSTREAM'}' size="30" /></td></tr> <tr><td align='left' colspan='2'><br /></td></tr> -<tr><td colspan='2' align='center'> <input type='hidden' name='ACTION' value=$Lang::tr{'save'} /> +<tr><td colspan='2' align='center'> <input type='hidden' name='ACTION' value='$Lang::tr{'save'}' /> <input type='image' alt='$Lang::tr{'save'}' title='$Lang::tr{'save'}' src='/images/floppy.gif' /></td></tr> </table></form> END -- 2.18.0
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.
But at the risk of sounding silly: I still got translation and designation(?) problems, sorry.
Hash tag = '$Lang::tr{'update'}'!?
Stringifying = ???
Greets, Bernhard
Gesendet: Dienstag, 29. Dezember 2020 um 13:50 Uhr Von: "Matthias Fischer" matthias.fischer@ipfire.org An: development@lists.ipfire.org Betreff: [PATCH] Syntax fixes in several CGIs
Signed-off-by: Matthias Fischer matthias.fischer@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...]
Hi,
Gesendet: Dienstag, 29. Dezember 2020 um 17:51 Uhr Von: "Matthias Fischer" matthias.fischer@ipfire.org An: "Bernhard Bitsch" Bernhard.Bitsch@gmx.de Cc: development@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@ipfire.org An: development@lists.ipfire.org Betreff: [PATCH] Syntax fixes in several CGIs
Signed-off-by: Matthias Fischer matthias.fischer@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...]
Hi,
On 29.12.2020 20:52, Bernhard Bitsch wrote:
...
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.
Ok, got it.
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.
Yep. Thanks a lot. ;-)
I hope I can remember this next time...
Best, Matthias
P.S.: I know, why I have specialized on hardware - software is more complicated. ;-)
Hi Matthias,
if you want to use longer texts as button names, I would like to suggest that you use the HTML "button" element. This element accepts a seperate description text and form value attribute. I think this would be the best option, because then the CGI "ACTION" parameter becomes independent of the translation strings.
Here you will find an example: https://www.w3schools.com/tags/att_button_name.asp
Best regards, Leo
Am 29.12.2020 um 17:51 schrieb Matthias Fischer:
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.
But at the risk of sounding silly: I still got translation and designation(?) problems, sorry.
Hash tag = '$Lang::tr{'update'}'!?
Stringifying = ???
Greets, Bernhard
Gesendet: Dienstag, 29. Dezember 2020 um 13:50 Uhr Von: "Matthias Fischer" matthias.fischer@ipfire.org An: development@lists.ipfire.org Betreff: [PATCH] Syntax fixes in several CGIs
Signed-off-by: Matthias Fischer matthias.fischer@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...]