Bug 8938 - Transport cost matrix script and template contain untranslatable strings
Summary: Transport cost matrix script and template contain untranslatable strings
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bernardo Gonzalez Kriegel
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-17 17:03 UTC by Owen Leonard
Modified: 2015-06-04 23:33 UTC (History)
6 users (show)

See Also:
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 (2.50 KB, patch)
2014-08-11 00:21 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 8938: Transport cost matrix script and template contain untranslatable strings (2.56 KB, patch)
2014-08-11 08:44 UTC, Chris Cormack
Details | Diff | Splinter Review
[Signed-off] Bug 8938: Transport cost matrix script and template contain untranslatable strings (2.77 KB, patch)
2014-08-11 09:10 UTC, Marc Véron
Details | Diff | Splinter Review
[PASSED QA] Bug 8938: Transport cost matrix script and template contain untranslatable strings (2.93 KB, patch)
2014-08-14 20:20 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!