Bug 7598

Summary: Acquisitions JavaScript contains untranslatable English strings
Product: Koha Reporter: Owen Leonard <oleonard>
Component: AcquisitionsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: normal    
Priority: P5 - low CC: bgkriegel, chrish, gmcharlt, jonathan.druart, tomascohen
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:
Circulation function:
Attachments: Bug 7598 - Acquisitions JavaScript contains untranslatable English strings
[SIGNED-OFF] Bug 7598 - Acquisitions JavaScript contains untranslatable English strings
Bug 7598 [Follow-up] Acquisitions JavaScript contains untranslatable English strings
Bug 7598 - Acquisitions JavaScript contains untranslatable English strings
Bug 7598 [Follow-up] Acquisitions JavaScript contains untranslatable English strings

Description Owen Leonard 2012-02-24 20:49:24 UTC
acq.js contains many examples:

    var answer=confirm(_("Are you sure you want to close this basketgroup?"));

The syntax would be correct if this were a template, but the translator script won't process this file so the messages need to be moved to the template.
Comment 1 Owen Leonard 2013-07-11 17:08:23 UTC Comment hidden (obsolete)
Comment 2 Srdjan Jankovic 2013-07-16 06:37:37 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2013-07-18 12:01:59 UTC
Owen,

I suspect you did not see the difference between these 2 lines:

-            return _("- Budget total exceeds parent allocation\n");
+            return MSG_BUDGET_PARENT_ALLOCATION;
     } else if (result == '2') {
-            return _("- Budget total exceeds period allocation\n");
+            return MSG_BUDGET_PARENT_ALLOCATION;

=> parent vs period.

Marked as Failed QA.
Comment 4 Owen Leonard 2013-07-18 15:33:19 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2013-07-19 07:37:55 UTC
QA comment:

Works as expected, all strings are in the po file.
It is a pity not to have js file translatable.

Marked as Passed QA.
Comment 6 Jonathan Druart 2013-07-19 07:38:16 UTC
second patch does not need a signoff.
Comment 7 Jonathan Druart 2013-07-19 07:38:57 UTC
Created attachment 19785 [details] [review]
Bug 7598 - Acquisitions JavaScript contains untranslatable English strings

English strings in acq.js cannot be processed by the translation script.
This patch moves the strings to the templates to be set as JS variables
for use by the script.

To test:

- On the uncertain prices page, enter an invalid price and click save.
  You should see a JavaScript alert pointing this out.

- When adding a fund to an existing budget, enter an amount which
  exceeds the amount in the parent budget. You should see a JavaScript
  alert pointing this out. There is a similar function which has been
  corrected, checkBudgetParent(), but I don't know how to trigger it for
  testing.

The closebasketgroup function has been updated but as far as I can tell
it's not actually in use.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 8 Jonathan Druart 2013-07-19 07:39:05 UTC
Created attachment 19786 [details] [review]
Bug 7598 [Follow-up] Acquisitions JavaScript contains untranslatable English strings

This follow-up addresses QA comments and moves punctuation and line
breaks out of the string to be translated.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 9 Galen Charlton 2013-07-19 12:53:53 UTC
Pushed to master.  Thanks, Owen!
Comment 10 Tomás Cohen Arazi (tcohen) 2013-08-14 14:29:55 UTC
This patch has been pushed to 3.12.x, will be in 3.12.4.

Thanks Owen!
Comment 11 Bernardo Gonzalez Kriegel 2013-09-13 21:27:29 UTC
Pushed to 3.10.x, will be in 3.10.11
Comment 12 Chris Hall 2013-09-16 08:09:06 UTC
Pushed to 3.8.x, will be in 3.8.18