You can find them easily with these commands: git grep "_(" koha-tmpl/intranet-tmpl/prog/js git grep "_(" koha-tmpl/opac-tmpl/bootstrap/js They should be fixed, see https://wiki.koha-community.org/wiki/Coding_Guidelines#JS5:_Enabling_translation_of_language_strings_in_linked_JavaScript
*** Bug 22601 has been marked as a duplicate of this bug. ***
I will create a xxx-strings.inc for each js
A Koha test must be provided here.
Won't be a problem with bug 21156.
Lowering severity.
Bug 24046 fixed "Activate filters"
Created attachment 133813 [details] [review] Bug 22490: Some strings in JavaScript files are untranslatable This patch updates the translation functions of the strings in Javascript files Test Plan: 1) Find a string in a popup or from a Javascript file who is still not translated or 1) Home > Administration > Authority types 2) Make sure to have at least one Authority type saved 3) Click on Action > Import 4) Import button without adding any file to trigger the popup 5) The string inside the popup appears without translation 6) Apply patch and repeat from 3) to 5) : now the string is translated
Created attachment 133906 [details] [review] Bug 22490: Some strings in JavaScript files are untranslatable This patch updates the translation functions of the strings in Javascript files Test Plan: 1) Find a string in a popup or from a Javascript file who is still not translated or 1) Home > Administration > Authority types 2) Make sure to have at least one Authority type saved 3) Click on Action > Import 4) Import button without adding any file to trigger the popup 5) The string inside the popup appears without translation 6) Apply patch and repeat from 3) to 5) : now the string is translated
Created attachment 134072 [details] [review] Bug 22490: Some strings in JavaScript files are untranslatable This patch updates the translation functions of the strings in Javascript files Test Plan: 1) Find a string in a popup or from a Javascript file who is still not translated or 1) Home > Administration > Authority types 2) Make sure to have at least one Authority type saved 3) Click on Action > Import 4) Import button without adding any file to trigger the popup 5) The string inside the popup appears without translation 6) Apply patch and repeat from 3) to 5) : now the string is translated
Created attachment 134204 [details] [review] Bug 22490: Some strings in JavaScript files are untranslatable This patch updates the translation functions of the strings in Javascript files Test Plan: 1) Find a string in a popup or from a Javascript file who is still not translated or 1) Home > Administration > Authority types 2) Make sure to have at least one Authority type saved 3) Click on Action > Import 4) Import button without adding any file to trigger the popup 5) The string inside the popup appears without translation 6) Apply patch and repeat from 3) to 5) : now the string is translated
Created attachment 134207 [details] [review] Bug 22490: Some strings in JavaScript files are untranslatable This patch updates the translation functions of the strings in Javascript files Test Plan: 1) Find a string in a popup or from a Javascript file who is still not translated or 1) Home > Administration > Authority types 2) Make sure to have at least one Authority type saved 3) Click on Action > Import 4) Import button without adding any file to trigger the popup 5) The string inside the popup appears without translation 6) Apply patch and repeat from 3) to 5) : now the string is translated
There are some more strings on master in these files: koha-tmpl/intranet-tmpl/prog/js/datatables.js (1 string) koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js (2 more strings) Found by: git grep '[^_]_(' koha-tmpl/intranet-tmpl/prog/js Also there are dummy functions defined in koha-tmpl/intranet-tmpl/prog/js/onboarding.js and koha-tmpl/intranet-tmpl/prog/js/staff-global.js. I am not sure what was this function meant to be for, but I believe it 'legitimate' the '_' function in javascript runtime
Created attachment 146854 [details] [review] Bug 22490: Some strings in JavaScript files are untranslatable Javascript function `_` works only if used in template file (.tt or .inc). In .js files we should use `__` This patch updates .js files to use `__` instead of `_` Test Plan: 1. Do not apply the patch yet 2. Run `npx gulp po:update --lang fr-FR` (choose another language if you prefer) 3. Open misc/translator/po/fr-FR-messages-js.po and search "Please select a CSV (.csv) or ODS (.ods) spreadsheet file" 4. Notice that the references above only mention biblio_framework.js 5. If not already translated, translate it 6. Run misc/translator/translate install fr-FR 7. Go to staff interface and change language to fr-FR 8. Go to Administration » Authority types and click on "Actions -> Import" 9. In the modal window, click on "Import" without selecting a file. You should see an alert with the non-translated text 10. Apply the patch 11. Run `npx gulp po:update --lang fr-FR` 12. Open misc/translator/po/fr-FR-messages-js.po and search "Please select a CSV (.csv) or ODS (.ods) spreadsheet file" 13. Notice that the references above now also mention authtype.js 14. If the translation is marked as fuzzy, remove the fuzzy flag 15. Run misc/translator/translate install fr-FR 16. Go to staff interface again 17. Go to Administration » Authority types and click on "Actions -> Import" 18. In the modal window, click on "Import" without selecting a file. You should see an alert, this time with the translated text
(In reply to Josef Moravec from comment #12) > There are some more strings on master in these files: > > koha-tmpl/intranet-tmpl/prog/js/datatables.js (1 string) > koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js (2 more strings) Fixed > Also there are dummy functions defined in > koha-tmpl/intranet-tmpl/prog/js/onboarding.js and > koha-tmpl/intranet-tmpl/prog/js/staff-global.js. > > I am not sure what was this function meant to be for, but I believe it > 'legitimate' the '_' function in javascript runtime It's used to detect translatable strings in .inc/.tt for the older translation system
Created attachment 146868 [details] [review] Bug 22490: Some strings in JavaScript files are untranslatable Javascript function `_` works only if used in template file (.tt or .inc). In .js files we should use `__` This patch updates .js files to use `__` instead of `_` Test Plan: 1. Do not apply the patch yet 2. Run `npx gulp po:update --lang fr-FR` (choose another language if you prefer) 3. Open misc/translator/po/fr-FR-messages-js.po and search "Please select a CSV (.csv) or ODS (.ods) spreadsheet file" 4. Notice that the references above only mention biblio_framework.js 5. If not already translated, translate it 6. Run misc/translator/translate install fr-FR 7. Go to staff interface and change language to fr-FR 8. Go to Administration » Authority types and click on "Actions -> Import" 9. In the modal window, click on "Import" without selecting a file. You should see an alert with the non-translated text 10. Apply the patch 11. Run `npx gulp po:update --lang fr-FR` 12. Open misc/translator/po/fr-FR-messages-js.po and search "Please select a CSV (.csv) or ODS (.ods) spreadsheet file" 13. Notice that the references above now also mention authtype.js 14. If the translation is marked as fuzzy, remove the fuzzy flag 15. Run misc/translator/translate install fr-FR 16. Go to staff interface again 17. Go to Administration » Authority types and click on "Actions -> Import" 18. In the modal window, click on "Import" without selecting a file. You should see an alert, this time with the translated text Signed-off-by: Owen Leonard <oleonard@myacpl.org>
How did we miss all those?
Created attachment 147337 [details] [review] Bug 22490: Some strings in JavaScript files are untranslatable Javascript function `_` works only if used in template file (.tt or .inc). In .js files we should use `__` This patch updates .js files to use `__` instead of `_` Test Plan: 1. Do not apply the patch yet 2. Run `npx gulp po:update --lang fr-FR` (choose another language if you prefer) 3. Open misc/translator/po/fr-FR-messages-js.po and search "Please select a CSV (.csv) or ODS (.ods) spreadsheet file" 4. Notice that the references above only mention biblio_framework.js 5. If not already translated, translate it 6. Run misc/translator/translate install fr-FR 7. Go to staff interface and change language to fr-FR 8. Go to Administration » Authority types and click on "Actions -> Import" 9. In the modal window, click on "Import" without selecting a file. You should see an alert with the non-translated text 10. Apply the patch 11. Run `npx gulp po:update --lang fr-FR` 12. Open misc/translator/po/fr-FR-messages-js.po and search "Please select a CSV (.csv) or ODS (.ods) spreadsheet file" 13. Notice that the references above now also mention authtype.js 14. If the translation is marked as fuzzy, remove the fuzzy flag 15. Run misc/translator/translate install fr-FR 16. Go to staff interface again 17. Go to Administration » Authority types and click on "Actions -> Import" 18. In the modal window, click on "Import" without selecting a file. You should see an alert, this time with the translated text Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
No patron-autocomplete.js in 22.05.x so this does not apply. No backport.