Bug 28536 - Move translatable strings into overdrive.js
Summary: Move translatable strings into overdrive.js
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 21156
Blocks: 28537
  Show dependency treegraph
 
Reported: 2021-06-09 16:23 UTC by Owen Leonard
Modified: 2021-09-21 18:19 UTC (History)
1 user (show)

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


Attachments
Bug 28536: Move translatable strings into overdrive.js (10.78 KB, patch)
2021-06-09 16:42 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28536: Move translatable strings into overdrive.js (10.79 KB, patch)
2021-06-09 16:43 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28536: Move translatable strings into overdrive.js (10.84 KB, patch)
2021-08-20 12:52 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 28536: Move translatable strings into overdrive.js (10.95 KB, patch)
2021-09-20 15:09 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2021-06-09 16:23:59 UTC
Strings defined for translation in opac-bottom.inc for use by OverDrive integration code can now be wrapped in the new translation function and put in overdrive.js.
Comment 1 Owen Leonard 2021-06-09 16:42:02 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2021-06-09 16:43:40 UTC Comment hidden (obsolete)
Comment 3 Tomás Cohen Arazi 2021-08-20 12:52:26 UTC
Created attachment 123999 [details] [review]
Bug 28536: Move translatable strings into overdrive.js

This patch takes strings defined as variables in opac-bottom.inc for use
in overdrive.js and moves them to overdrive.js, wrapped in the
double-underscore translation function.

To test you must have valid credentials entered in system preferences
for the OverDrive API. Ideally you should test using a patron who has
holds and current checkouts in OverDrive.

Apply the patch and log in to the OPAC.

- On the "Your summary" page, open the "OverDrive Account" tab.
  - Log in to your OverDrive account.
  - The contents of the tab should display correctly, with correct
    labels for controls like "Log out of your OverDrive account", "Check
    in", "On hold", etc.
- Perform a catalog search which will return results also found in your
  OverDrive collection.
  - Open the OverDrive results page.
  - The page should display correctly, with correct labels on controls
    like "Check out" and "Place hold."

To test that the correct strings are translatable. In this example I'm
testing fr-FR:

 - Update a translation:

  > gulp po:update
  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for the strings pulled from
  JavaScript  e.g.  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from bootstrap/js/overdrive.js for
  translation, e.g.:

  koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js:124
  msgid "OverDrive account page"
  msgstr ""

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

  > perl translate install fr-FR

In the OPAC, switch to the language you're testing. Confirm that your
translated strings appear. In the above example, the string should
appear at the top of the "Overdrive Account" tab.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Nick Clemens 2021-09-20 15:09:23 UTC
Created attachment 125071 [details] [review]
Bug 28536: Move translatable strings into overdrive.js

This patch takes strings defined as variables in opac-bottom.inc for use
in overdrive.js and moves them to overdrive.js, wrapped in the
double-underscore translation function.

To test you must have valid credentials entered in system preferences
for the OverDrive API. Ideally you should test using a patron who has
holds and current checkouts in OverDrive.

Apply the patch and log in to the OPAC.

- On the "Your summary" page, open the "OverDrive Account" tab.
  - Log in to your OverDrive account.
  - The contents of the tab should display correctly, with correct
    labels for controls like "Log out of your OverDrive account", "Check
    in", "On hold", etc.
- Perform a catalog search which will return results also found in your
  OverDrive collection.
  - Open the OverDrive results page.
  - The page should display correctly, with correct labels on controls
    like "Check out" and "Place hold."

To test that the correct strings are translatable. In this example I'm
testing fr-FR:

 - Update a translation:

  > gulp po:update
  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for the strings pulled from
  JavaScript  e.g.  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from bootstrap/js/overdrive.js for
  translation, e.g.:

  koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js:124
  msgid "OverDrive account page"
  msgstr ""

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

  > perl translate install fr-FR

In the OPAC, switch to the language you're testing. Confirm that your
translated strings appear. In the above example, the string should
appear at the top of the "Overdrive Account" tab.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

https://bugs.koha-community.org/show_bug.cgi?id=28356
Comment 5 Jonathan Druart 2021-09-21 18:19:06 UTC
Pushed to master for 21.11, thanks to everybody involved!