In the template, a string in JavaScript is not wrapped in the proper function: alert("Cost must be expressed as a decimal number >= 0"); In the script, error messages are built with English strings and passed whole to the template: push @errors, "Invalid value for $from_row{name} -> $from_to_input_def{name}"
Created attachment 30676 [details] [review] Bug 8938: Transport cost matrix script and template contain untranslatable strings This patch fixes the problem reported. To test: 1) Apply the patch 2) Update translations for your preffered language, xx-YY 3) Check new entries egrep -Rn "Cost must be expressed as a decimal number|Invalid value for" misc/translator/xx-YY* 4) Check no regression on alert, go to Administration > Transport cost matrix Edit some value and put a negative value & save, alert must show up 5) On errors, part of the error string is now on TT file, no regressions expected here
Created attachment 30683 [details] [review] Bug 8938: Transport cost matrix script and template contain untranslatable strings This patch fixes the problem reported. To test: 1) Apply the patch 2) Update translations for your preffered language, xx-YY 3) Check new entries egrep -Rn "Cost must be expressed as a decimal number|Invalid value for" misc/translator/xx-YY* 4) Check no regression on alert, go to Administration > Transport cost matrix Edit some value and put a negative value & save, alert must show up 5) On errors, part of the error string is now on TT file, no regressions expected here Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 30686 [details] [review] [Signed-off] Bug 8938: Transport cost matrix script and template contain untranslatable strings This patch fixes the problem reported. To test: 1) Apply the patch 2) Update translations for your preffered language, xx-YY 3) Check new entries egrep -Rn "Cost must be expressed as a decimal number|Invalid value for" misc/translator/xx-YY* 4) Check no regression on alert, go to Administration > Transport cost matrix Edit some value and put a negative value & save, alert must show up 5) On errors, part of the error string is now on TT file, no regressions expected here Verified that changes appear in translated language (de-CH) as appropriate. No regressions found by testing en en de-CH. Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 30803 [details] [review] [PASSED QA] Bug 8938: Transport cost matrix script and template contain untranslatable strings This patch fixes the problem reported. To test: 1) Apply the patch 2) Update translations for your preffered language, xx-YY 3) Check new entries egrep -Rn "Cost must be expressed as a decimal number|Invalid value for" misc/translator/xx-YY* 4) Check no regression on alert, go to Administration > Transport cost matrix Edit some value and put a negative value & save, alert must show up 5) On errors, part of the error string is now on TT file, no regressions expected here Verified that changes appear in translated language (de-CH) as appropriate. No regressions found by testing en en de-CH. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Tested both, entering a numeric value < 0 and non-numeric values, no regressions found. Passes tests and QA script.
Patch pushed to master. Thanks Bernardo!