Bug 11227

Summary: Staff po files contain some Javascript
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: I18N/L10NAssignee: Bernardo Gonzalez Kriegel <bgkriegel>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: bgkriegel, f.demians, gmcharlt
Version: Main   
Hardware: All   
OS: All   
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
[SIGNED-OFF] Bug 11227 - Staff po files contain some Javascript
[PASSED QA] Bug 11227 - Staff po files contain some Javascript

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!