Bug 25351 - Move cart-related strings out of opac-bottom.inc and into basket.js
Summary: Move cart-related strings out of opac-bottom.inc and into basket.js
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 21156
Blocks: 26719
  Show dependency treegraph
 
Reported: 2020-05-01 22:10 UTC by Owen Leonard
Modified: 2021-06-14 21:31 UTC (History)
6 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, 20.05.03, 19.11.09


Attachments
Bug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js (11.76 KB, patch)
2020-06-18 14:15 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js (11.79 KB, patch)
2020-07-21 18:20 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js (11.87 KB, patch)
2020-07-29 21:27 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-05-01 22:10:38 UTC
Cart-related strings which were put in opac-bottom.inc for translation purposes can now be wrapped in the new translation function and put in basket.js
Comment 1 Owen Leonard 2020-06-18 14:15:18 UTC Comment hidden (obsolete)
Comment 2 Tomás Cohen Arazi 2020-07-21 18:19:50 UTC
Tested with es-ES and works like a charm.
Comment 3 Tomás Cohen Arazi 2020-07-21 18:20:45 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2020-07-29 21:27:50 UTC
Created attachment 107537 [details] [review]
Bug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js

This patch adds the necessary JavaScript includes to the OPAC to
enable translation of strings in JavaScript. It also updates the
translation of cart-related strings by removing the strings from
opac-bottom.inc and putting them in basket.js where they are used.

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

 - Update a translation:

   > 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/basket.js for
   translation, e.g.:

   #: koha-tmpl/opac-tmpl/bootstrap/js/basket.js:89
   msgid "Your cart is currently empty"
   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 string appears. In the above example, by clicking the "Cart"
icon in the header when there are no items in the cart.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2020-07-30 15:46:46 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 6 Lucas Gass 2020-08-06 20:13:04 UTC
This enhancement improves translatability so I am choosing to backport this to 20.05.x for 20.05.03
Comment 7 Aleisha Amohia 2020-08-07 02:08:18 UTC
backported to 19.11.x for 19.11.09
Comment 8 Victor Grousset/tuxayo 2020-09-20 10:22:58 UTC
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.