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)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Tue, 28 Feb 2023 10:11:26 +0000 (10:11 +0000)
commit6800a10e1627843520bc49700a4de537a8088ac0
treee5541d415b5870e1ef119e11b5cbb41fad2f4962
parent8982bb13d0416da4156e6ae414da6e917234fb91
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>
(cherry picked from commit 6498c5835c99bfc628ae87bbc43808dfd89f0d87)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
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