Bug 7598 - Acquisitions JavaScript contains untranslatable English strings
Summary: Acquisitions JavaScript contains untranslatable English strings
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-24 20:49 UTC by Owen Leonard
Modified: 2014-12-07 20:02 UTC (History)
5 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 7598 - Acquisitions JavaScript contains untranslatable English strings (7.07 KB, patch)
2013-07-11 17:08 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 7598 - Acquisitions JavaScript contains untranslatable English strings (7.09 KB, patch)
2013-07-16 06:37 UTC, Srdjan Jankovic
Details | Diff | Splinter Review
Bug 7598 [Follow-up] Acquisitions JavaScript contains untranslatable English strings (2.23 KB, patch)
2013-07-18 15:33 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 7598 - Acquisitions JavaScript contains untranslatable English strings (7.14 KB, patch)
2013-07-19 07:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7598 [Follow-up] Acquisitions JavaScript contains untranslatable English strings (2.27 KB, patch)
2013-07-19 07:39 UTC, Jonathan Druart
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-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 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