Summary: | Move cart-related strings out of opac-bottom.inc and into basket.js | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | I18N/L10N | Assignee: | Bugs List <koha-bugs> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | aleisha, f.demians, lucas, testopia, tomascohen, victor |
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: |
20.11.00, 20.05.03, 19.11.09
|
|
Circulation function: | |||
Bug Depends on: | 21156 | ||
Bug Blocks: | 26719 | ||
Attachments: |
Bug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js
Bug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js Bug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js |
Description
Owen Leonard
2020-05-01 22:10:38 UTC
Created attachment 106012 [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. Tested with es-ES and works like a charm. Created attachment 107170 [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> 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> Pushed to master for 20.11, thanks to everybody involved! This enhancement improves translatability so I am choosing to backport this to 20.05.x for 20.05.03 backported to 19.11.x for 19.11.09 Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed. |