Bug 22490: Some strings in JavaScript files are untranslatable
authorJérémy Breuillard <jeremy.breuillard@biblibre.com>
Mon, 25 Apr 2022 13:03:32 +0000 (15:03 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 24 Feb 2023 19:41:31 +0000 (16:41 -0300)
commit6498c5835c99bfc628ae87bbc43808dfd89f0d87
treefd6a5044aeb1547d1e0f5f47deb7e338efd1158e
parentc564c8a69614b7f43584d7cdd9f5ffbdfff9a935
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 files changed:
koha-tmpl/intranet-tmpl/prog/js/authtype.js
koha-tmpl/intranet-tmpl/prog/js/background-job-progressbar.js
koha-tmpl/intranet-tmpl/prog/js/calendar.js
koha-tmpl/intranet-tmpl/prog/js/datatables.js
koha-tmpl/intranet-tmpl/prog/js/item_search_fields.js
koha-tmpl/intranet-tmpl/prog/js/letter.js
koha-tmpl/intranet-tmpl/prog/js/pages/results.js
koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js
koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js
koha-tmpl/intranet-tmpl/prog/js/resolve_claim_modal.js
koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js
koha-tmpl/intranet-tmpl/prog/js/xmlControlfield.js