Strings defined for translation in memberentrygen.tt can now be wrapped in the new translation function and put in members.js and messaging-preference-form.js.
Created attachment 108688 [details] [review] Bug 26243: Move translatable strings out of memberentrygen.tt and into JavaScript This patch removes the definition of translatable strings out of templates and into the corresponding JavaScript file, using the new JS i81n function. Note: I was unable to trigger the confirmation message in the check_form_borrowers function. I think the form is now structured in a way that it is never triggered, thus a candidate for removal. To test: - Apply the patch and go to Patrons. - Add or edit a patron. - Select a date of birth at least one month in the past and confirm that the patron's age is displayed in the hint below. - Test multiple variations to confirm that the singular and plural of 'year' and 'month' display correctly. (e.g. 1 year 9 months, 2 years, etc). - Set some patron messaging preferences for the patron. - Change the patron category. - You should get a confirmation: "Change messaging preferences to default for this category?" 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/members.js for translation, e.g.: msgid "%s years" 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.
Hi Owen. I'm not sure what I'm doing wrong for this one. I've tried several times. But whatever I try I can't get it to recognise changes for the age/month/year phrases or the message when changing patron category. David
Created attachment 126581 [details] [review] Bug 26244: Move translatable strings out of memberentrygen.tt and into JavaScript This patch removes the definition of translatable strings out of templates and into the corresponding JavaScript file, using the new JS i81n function. Note: I was unable to trigger the confirmation message in the check_form_borrowers function. I think the form is now structured in a way that it is never triggered, thus a candidate for removal. To test: - Apply the patch and go to Patrons. - Add or edit a patron. - Select a date of birth at least one month in the past and confirm that the patron's age is displayed in the hint below. - Test multiple variations to confirm that the singular and plural of 'year' and 'month' display correctly. (e.g. 1 year 9 months, 2 years, etc). - Set some patron messaging preferences for the patron. - Change the patron category. - You should get a confirmation: "Change messaging preferences to default for this category?" 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/members.js for translation, e.g.: msgid "%s years" 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.
Please note that a bug in memberentry.pl could prevent complete testing of this patch. If you have switched to fr-FR, for example, and are editing an existing patron record, the "lang" variable will not be correctly set in the template, causing the localization file to be omitted. One way around this would be to set borrowers.lang in the patron record you are testing to match the language, e.g. 'fr-FR'
Created attachment 131540 [details] [review] Bug 26244: Move translatable strings out of memberentrygen.tt and into JavaScript This patch removes the definition of translatable strings out of templates and into the corresponding JavaScript file, using the new JS i81n function. Note: I was unable to trigger the confirmation message in the check_form_borrowers function. I think the form is now structured in a way that it is never triggered, thus a candidate for removal. To test: - Apply the patch and go to Patrons. - Add or edit a patron. - Select a date of birth at least one month in the past and confirm that the patron's age is displayed in the hint below. - Test multiple variations to confirm that the singular and plural of 'year' and 'month' display correctly. (e.g. 1 year 9 months, 2 years, etc). - Set some patron messaging preferences for the patron. - Change the patron category. - You should get a confirmation: "Change messaging preferences to default for this category?" 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/members.js for translation, e.g.: msgid "%s years" 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: Fridolin Somers <fridolin.somers@biblibre.com>
I've checked that each text is well moved and appears in PO files after translation update.
Created attachment 132806 [details] [review] Bug 26244: Move translatable strings out of memberentrygen.tt and into JavaScript This patch removes the definition of translatable strings out of templates and into the corresponding JavaScript file, using the new JS i81n function. Note: I was unable to trigger the confirmation message in the check_form_borrowers function. I think the form is now structured in a way that it is never triggered, thus a candidate for removal. To test: - Apply the patch and go to Patrons. - Add or edit a patron. - Select a date of birth at least one month in the past and confirm that the patron's age is displayed in the hint below. - Test multiple variations to confirm that the singular and plural of 'year' and 'month' display correctly. (e.g. 1 year 9 months, 2 years, etc). - Set some patron messaging preferences for the patron. - Change the patron category. - You should get a confirmation: "Change messaging preferences to default for this category?" 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/members.js for translation, e.g.: msgid "%s years" 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: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 22.05, thanks to everybody involved [U+1F984]