system.cgi: properly translate load average graph

Message ID ce11e44c-23bf-6bfb-1cc3-5ecd5f4d0dfa@ipfire.org
State Accepted
Commit a0774e3cc870700e62da49ec590cafea2006a454
Headers
Series system.cgi: properly translate load average graph |

Commit Message

Peter Müller April 27, 2020, 3:37 p.m. UTC
  Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 config/cfgroot/graphs.pl | 2 +-
 html/cgi-bin/system.cgi  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Michael Tremer April 27, 2020, 3:48 p.m. UTC | #1
Hi,

> On 27 Apr 2020, at 16:37, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
> ---
> config/cfgroot/graphs.pl | 2 +-
> html/cgi-bin/system.cgi  | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/config/cfgroot/graphs.pl b/config/cfgroot/graphs.pl
> index 1bed49fa3..928a74cfb 100644
> --- a/config/cfgroot/graphs.pl
> +++ b/config/cfgroot/graphs.pl
> @@ -256,7 +256,7 @@ sub updateloadgraph {
> 		"-1".$period,
> 		"-l 0",
> 		"-r",
> -		"-t Load Average ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
> +		"-t ".$Lang::tr{'uptime load average'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
> 		"-v ".$Lang::tr{'processes'},
> 		"--color=SHADEA".$color{"color19"},
> 		"--color=SHADEB".$color{"color19"},
> diff --git a/html/cgi-bin/system.cgi b/html/cgi-bin/system.cgi
> index 487ba996c..2c83f1e81 100644
> --- a/html/cgi-bin/system.cgi
> +++ b/html/cgi-bin/system.cgi
> @@ -66,7 +66,7 @@ if ( $querry[0] =~ "cpufreq"){
> 		&Header::closebox();
> 	}
> 
> -	&Header::openbox('100%', 'center', "Load $Lang::tr{'graph'}");
> +	&Header::openbox('100%', 'center', "$Lang::tr{'uptime load average'} $Lang::tr{'graph'}");

You are concatenating two strings here. This might work in English, but not in other languages.

So the correct way would be to have “uptime load average graph” as one string.

Best,
-Michael

> 	&Graphs::makegraphbox("system.cgi","load","day");
> 	&Header::closebox();
> 
> -- 
> 2.16.4
  
Peter Müller April 27, 2020, 4:11 p.m. UTC | #2
Hello Michael,

> Hi,
> 
>> On 27 Apr 2020, at 16:37, Peter Müller <peter.mueller@ipfire.org> wrote:
>>
>> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
>> ---
>> config/cfgroot/graphs.pl | 2 +-
>> html/cgi-bin/system.cgi  | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/config/cfgroot/graphs.pl b/config/cfgroot/graphs.pl
>> index 1bed49fa3..928a74cfb 100644
>> --- a/config/cfgroot/graphs.pl
>> +++ b/config/cfgroot/graphs.pl
>> @@ -256,7 +256,7 @@ sub updateloadgraph {
>> 		"-1".$period,
>> 		"-l 0",
>> 		"-r",
>> -		"-t Load Average ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
>> +		"-t ".$Lang::tr{'uptime load average'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
>> 		"-v ".$Lang::tr{'processes'},
>> 		"--color=SHADEA".$color{"color19"},
>> 		"--color=SHADEB".$color{"color19"},
>> diff --git a/html/cgi-bin/system.cgi b/html/cgi-bin/system.cgi
>> index 487ba996c..2c83f1e81 100644
>> --- a/html/cgi-bin/system.cgi
>> +++ b/html/cgi-bin/system.cgi
>> @@ -66,7 +66,7 @@ if ( $querry[0] =~ "cpufreq"){
>> 		&Header::closebox();
>> 	}
>>
>> -	&Header::openbox('100%', 'center', "Load $Lang::tr{'graph'}");
>> +	&Header::openbox('100%', 'center', "$Lang::tr{'uptime load average'} $Lang::tr{'graph'}");
> 
> You are concatenating two strings here. This might work in English, but not in other languages.
> 
> So the correct way would be to have “uptime load average graph” as one string.

I agree. Unfortunately, we did the same thing in other places so this probably requires some
clean up effort > 5 minutes. :-/ In the meantime, this can be merged or dropped.

Thanks, and best regards,
Peter Müller

> 
> Best,
> -Michael
> 
>> 	&Graphs::makegraphbox("system.cgi","load","day");
>> 	&Header::closebox();
>>
>> -- 
>> 2.16.4
>
  
Michael Tremer April 27, 2020, 8:57 p.m. UTC | #3
Hi,

> On 27 Apr 2020, at 17:11, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> Hello Michael,
> 
>> Hi,
>> 
>>> On 27 Apr 2020, at 16:37, Peter Müller <peter.mueller@ipfire.org> wrote:
>>> 
>>> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
>>> ---
>>> config/cfgroot/graphs.pl | 2 +-
>>> html/cgi-bin/system.cgi  | 2 +-
>>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/config/cfgroot/graphs.pl b/config/cfgroot/graphs.pl
>>> index 1bed49fa3..928a74cfb 100644
>>> --- a/config/cfgroot/graphs.pl
>>> +++ b/config/cfgroot/graphs.pl
>>> @@ -256,7 +256,7 @@ sub updateloadgraph {
>>> 		"-1".$period,
>>> 		"-l 0",
>>> 		"-r",
>>> -		"-t Load Average ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
>>> +		"-t ".$Lang::tr{'uptime load average'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
>>> 		"-v ".$Lang::tr{'processes'},
>>> 		"--color=SHADEA".$color{"color19"},
>>> 		"--color=SHADEB".$color{"color19"},
>>> diff --git a/html/cgi-bin/system.cgi b/html/cgi-bin/system.cgi
>>> index 487ba996c..2c83f1e81 100644
>>> --- a/html/cgi-bin/system.cgi
>>> +++ b/html/cgi-bin/system.cgi
>>> @@ -66,7 +66,7 @@ if ( $querry[0] =~ "cpufreq"){
>>> 		&Header::closebox();
>>> 	}
>>> 
>>> -	&Header::openbox('100%', 'center', "Load $Lang::tr{'graph'}");
>>> +	&Header::openbox('100%', 'center', "$Lang::tr{'uptime load average'} $Lang::tr{'graph'}");
>> 
>> You are concatenating two strings here. This might work in English, but not in other languages.
>> 
>> So the correct way would be to have “uptime load average graph” as one string.
> 
> I agree. Unfortunately, we did the same thing in other places so this probably requires some
> clean up effort > 5 minutes. :-/ In the meantime, this can be merged or dropped.

I would recommend to merge this patch, but only together with one that cleans up this and other split strings.

We will otherwise forget about this very quickly.

Best,
-Michael

> Thanks, and best regards,
> Peter Müller
> 
>> 
>> Best,
>> -Michael
>> 
>>> 	&Graphs::makegraphbox("system.cgi","load","day");
>>> 	&Header::closebox();
>>> 
>>> -- 
>>> 2.16.4
  

Patch

diff --git a/config/cfgroot/graphs.pl b/config/cfgroot/graphs.pl
index 1bed49fa3..928a74cfb 100644
--- a/config/cfgroot/graphs.pl
+++ b/config/cfgroot/graphs.pl
@@ -256,7 +256,7 @@  sub updateloadgraph {
 		"-1".$period,
 		"-l 0",
 		"-r",
-		"-t Load Average ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
+		"-t ".$Lang::tr{'uptime load average'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
 		"-v ".$Lang::tr{'processes'},
 		"--color=SHADEA".$color{"color19"},
 		"--color=SHADEB".$color{"color19"},
diff --git a/html/cgi-bin/system.cgi b/html/cgi-bin/system.cgi
index 487ba996c..2c83f1e81 100644
--- a/html/cgi-bin/system.cgi
+++ b/html/cgi-bin/system.cgi
@@ -66,7 +66,7 @@  if ( $querry[0] =~ "cpufreq"){
 		&Header::closebox();
 	}
 
-	&Header::openbox('100%', 'center', "Load $Lang::tr{'graph'}");
+	&Header::openbox('100%', 'center', "$Lang::tr{'uptime load average'} $Lang::tr{'graph'}");
 	&Graphs::makegraphbox("system.cgi","load","day");
 	&Header::closebox();