Strings which were put in strings.inc for translation purposes can now be wrapped in the new translation function and put in the various JavaScript files where they're used.
Files to be updated: checkouts.js holds.js results.js
Created attachment 106026 [details] [review] Bug 25321: (Part 1) Move translatable strings out of strings.inc into checkouts.js This patch movies translatable strings out of an include file and into the JavaScript file where the string is used. It is no longer necessary to have such strings in a Template::Toolkit file in order for them to be translated. To test, apply the patch and test that the correct strings appear in the staff client. For instance: - The "Claim returned" button in the patron's table of checkouts. - The "Today's checkouts" and "Previous checkouts" headers in the table of checkouts. - The "On hold" message in the "Renew" column in the table of checkouts when the item is on hold for another patron. 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 prog/js/checkouts.js for translation, e.g.: #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:560 msgid "Claim returned" msgstr "" - Edit the "msgstr" string however you want (it's just for testing) - Install the updated translation: > perl translate install fr-FR In the staff client, switch to the language you're testing. Confirm that your translated string appears. In the above example, by opening the checkouts page for a patron who has items checked out. In the "Déclarés rendus" column, confirm that the "Claim returned" button text appears as you translated it.
Created attachment 106027 [details] [review] Bug 25321: (Part 1) Move translatable strings out of strings.inc into checkouts.js This patch movies translatable strings out of an include file and into the JavaScript file where the string is used. It is no longer necessary to have such strings in a Template::Toolkit file in order for them to be translated. To test, apply the patch and test that the correct strings appear in the staff client. For instance: - The "Claim returned" button in the patron's table of checkouts. - The "Today's checkouts" and "Previous checkouts" headers in the table of checkouts. - The "On hold" message in the "Renew" column in the table of checkouts when the item is on hold for another patron. 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 prog/js/checkouts.js for translation, e.g.: #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:560 msgid "Claim returned" msgstr "" - Edit the "msgstr" string however you want (it's just for testing) - Install the updated translation: > perl translate install fr-FR In the staff client, switch to the language you're testing. Confirm that your translated string appears. In the above example, by opening the checkouts page for a patron who has items checked out. In the "Déclarés rendus" column, confirm that the "Claim returned" button text appears as you translated it.
Created attachment 109031 [details] [review] Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript This patch moves string definitions out of strings.inc and into the corresponding JavaScript files. To test, apply the patch and test various pages in the staff interface: A few suggestions: - Perform a catalog search and view the detail page for a bibliographic record. - Confirm that the search results browser in the left-hand sidebar work correctly and that the title attributes of the controls are correct. - Locate a patron with multiple checkouts. View the checkout page and test the various controls in the table of checkouts: Renew, check in, return claims, etc. - View the list of holds on a patron's account. Test suspending and resuming holds. 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/checkouts.js for translation, e.g.: msgid "Checked in" 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 strings should appear.
Created attachment 109858 [details] [review] Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript This patch moves string definitions out of strings.inc and into the corresponding JavaScript files. To test, apply the patch and test various pages in the staff interface: A few suggestions: - Perform a catalog search and view the detail page for a bibliographic record. - Confirm that the search results browser in the left-hand sidebar work correctly and that the title attributes of the controls are correct. - Locate a patron with multiple checkouts. View the checkout page and test the various controls in the table of checkouts: Renew, check in, return claims, etc. - View the list of holds on a patron's account. Test suspending and resuming holds. 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/checkouts.js for translation, e.g.: msgid "Checked in" 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 strings should appear.
Created attachment 109971 [details] [review] Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript This patch moves string definitions out of strings.inc and into the corresponding JavaScript files. To test, apply the patch and test various pages in the staff interface: A few suggestions: - Perform a catalog search and view the detail page for a bibliographic record. - Confirm that the search results browser in the left-hand sidebar work correctly and that the title attributes of the controls are correct. - Locate a patron with multiple checkouts. View the checkout page and test the various controls in the table of checkouts: Renew, check in, return claims, etc. - View the list of holds on a patron's account. Test suspending and resuming holds. 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/checkouts.js for translation, e.g.: msgid "Checked in" 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 strings should appear. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 109984 [details] [review] Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript This patch moves string definitions out of strings.inc and into the corresponding JavaScript files. To test, apply the patch and test various pages in the staff interface: A few suggestions: - Perform a catalog search and view the detail page for a bibliographic record. - Confirm that the search results browser in the left-hand sidebar work correctly and that the title attributes of the controls are correct. - Locate a patron with multiple checkouts. View the checkout page and test the various controls in the table of checkouts: Renew, check in, return claims, etc. - View the list of holds on a patron's account. Test suspending and resuming holds. 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/checkouts.js for translation, e.g.: msgid "Checked in" 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 strings should appear. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 110893 [details] [review] Bug 25321: Remove PLACE_HOLD from results.js
Cannot edit a biblio: Template process failed: file error - strings.inc: not found at /kohadevbox/koha/C4/Templates.pm line 122 There are 2 remaining occurrences of strings.inc koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt:[% INCLUDE 'strings.inc' %] koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt:[% INCLUDE 'strings.inc' %]
Created attachment 110906 [details] [review] Bug 25321: Remove 2 remaining occurrences of strings.inc They were used for browser.js
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.05
enhancement, not backported to 19.11.x