Bug 11227 - Staff po files contain some Javascript
Summary: Staff po files contain some Javascript
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bernardo Gonzalez Kriegel
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-09 19:54 UTC by Katrin Fischer
Modified: 2014-12-07 20:07 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11227 - Staff po files contain some Javascript (3.09 KB, patch)
2014-04-03 13:24 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 11227 - Staff po files contain some Javascript (3.19 KB, patch)
2014-04-21 19:17 UTC, Owen Leonard
Details | Diff | Splinter Review
[PASSED QA] Bug 11227 - Staff po files contain some Javascript (3.30 KB, patch)
2014-04-26 21:29 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 Katrin Fischer 2013-11-09 19:54:41 UTC
The new staff po files contain a lot of Javascript strings:

Example: authorities_js.inc
"function mergeAuth(authid, summary) { var alreadySelected = $.cookie('auth_to_merge'); if (alreadySelected !== null) { alreadySelected = JSON.parse(alreadySelected); $.cookie('auth_to_merge', '', { 'path': '/', 'expires': -1 }); var refstring = \"\"; if (typeof alreadySelected.mergereference !== 'undefined') { refstring = \"&mergereference=\" + alreadySelected.mergereference; } window.location.href = \"/cgi-bin/koha/authorities/merge.pl?authid=\" + authid + \"&authid=\" + alreadySelected.authid + refstring; } else { $.cookie('auth_to_merge', JSON.stringify({ 'authid': authid, 'summary': summary }), { 'path' : '/' }); showMergingInProgress(); } } function showMergingInProgress() { var alreadySelected = $.cookie('auth_to_merge'); if (alreadySelected !== null) { alreadySelected = JSON.parse(alreadySelected); $('#merge_in_progress').html(_(\"Merging with authority: \") + \""
Comment 1 Bernardo Gonzalez Kriegel 2014-04-03 13:24:45 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2014-04-21 19:17:21 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-04-26 21:29:41 UTC
Created attachment 27672 [details] [review]
[PASSED QA] Bug 11227 - Staff po files contain some Javascript

This patch rewrites authorities_js.inc so translate
script process it correctly. To that I add
<script></script> at the file

To test:
1) Update po files for your preffered language

2) Check occurrence of mergeAuth on staff PO file
or try
egrep -n  "Merging with authority: |Cancel merge"
strings appear in a JS func

3) Apply the patch

4) Update translations again, chech again, old
strings now begin with #~ (obsoleted) and there
are new entries for the messages

5) Check functionality provided by script

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described and fixes a translation difficulty.
Comment 4 Galen Charlton 2014-04-27 22:05:32 UTC
Pushed to master.  Thanks, Bernardo!