Bug 8938

Summary: Transport cost matrix script and template contain untranslatable strings
Product: Koha Reporter: Owen Leonard <oleonard>
Component: I18N/L10NAssignee: Bernardo Gonzalez Kriegel <bgkriegel>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5 - low CC: bgkriegel, f.demians, gmcharlt, katrin.fischer, tomascohen, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 8938: Transport cost matrix script and template contain untranslatable strings
Bug 8938: Transport cost matrix script and template contain untranslatable strings
[Signed-off] Bug 8938: Transport cost matrix script and template contain untranslatable strings
[PASSED QA] Bug 8938: Transport cost matrix script and template contain untranslatable strings

Description Owen Leonard 2012-10-17 17:03:42 UTC
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}"
Comment 1 Bernardo Gonzalez Kriegel 2014-08-11 00:21:07 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-08-11 08:44:39 UTC Comment hidden (obsolete)
Comment 3 Marc Véron 2014-08-11 09:10:13 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2014-08-14 20:20:54 UTC
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.
Comment 5 Tomás Cohen Arazi 2014-08-14 23:38:54 UTC
Patch pushed to master.

Thanks Bernardo!