Bug 26065 - Move translatable strings out of marc_modification_templates.tt and into marc_modification_templates.js
Summary: Move translatable strings out of marc_modification_templates.tt and into marc...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 21156
Blocks: 25694
  Show dependency treegraph
 
Reported: 2020-07-24 23:10 UTC by Owen Leonard
Modified: 2021-06-14 21:33 UTC (History)
4 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:
20.11.00
Circulation function:


Attachments
Bug 26065: Move translatable strings out of marc_modification_templates.tt and into marc_modification_templates.js (9.35 KB, patch)
2020-07-27 14:25 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 26065: Move translatable strings out of marc_modification_templates.tt and into marc_modification_templates.js (9.35 KB, patch)
2020-07-29 22:21 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 2020-07-24 23:10:04 UTC
Strings defined for translation in marc_modification_templates.tt can now be wrapped in the new translation function and put in marc_modification_templates.js.
Comment 1 Owen Leonard 2020-07-27 14:25:27 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2020-07-29 22:21:05 UTC
Created attachment 107550 [details] [review]
Bug 26065: Move translatable strings out of marc_modification_templates.tt and into marc_modification_templates.js

This patch removes the <script> block in the MARC modification
templates template in which strings are defined for translation
purposes.

Strings are now in place in the JavaScript file and wrapped in the new
__() function.

To test, apply the patch and clear your browser cache if necessary.

- Perform some actions which will trigger translated strings, for
  example:
  - Create a new template
  - Add an action to the template and then delete it.
    - The confirmation should appear correctly
  - Add an action. Select "Copy" as the operation and click "Add action"
    without filling in any fields.
    - You should see a message, "Both subfield values should be filled
      or empty"

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

> cd misc/translator
> perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js for
  translation, e.g.:

  msgid "Both subfield values should be filled or empty."
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

> perl translate install fr-FR

- Switch to your newly translated language in the staff client and
  repeat the test plan above. The translated string should appear.
Comment 3 Jonathan Druart 2020-08-18 10:10:05 UTC
Skipping QA, I will review it myself.
Comment 4 Jonathan Druart 2020-08-18 15:47:12 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 5 Lucas Gass (lukeg) 2020-09-04 15:26:30 UTC
enhancement will not be backported to 20.05.x