Bug 22490 - Some strings in JavaScript files are untranslatable
Summary: Some strings in JavaScript files are untranslatable
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Julian Maurice
QA Contact: Testopia
URL:
Keywords:
: 22601 (view as bug list)
Depends on: 22114 22904 24046
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-11 11:20 UTC by Josef Moravec
Modified: 2022-09-08 14:20 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 22490: Some strings in JavaScript files are untranslatable (5.12 KB, patch)
2022-04-25 14:51 UTC, Jérémy Breuillard
Details | Diff | Splinter Review
Bug 22490: Some strings in JavaScript files are untranslatable (12.97 KB, patch)
2022-04-26 14:13 UTC, Jérémy Breuillard
Details | Diff | Splinter Review
Bug 22490: Some strings in JavaScript files are untranslatable (14.08 KB, patch)
2022-04-27 14:24 UTC, Jérémy Breuillard
Details | Diff | Splinter Review
Bug 22490: Some strings in JavaScript files are untranslatable (11.53 KB, patch)
2022-04-28 07:50 UTC, Jérémy Breuillard
Details | Diff | Splinter Review
Bug 22490: Some strings in JavaScript files are untranslatable (11.24 KB, patch)
2022-04-28 09:16 UTC, Jérémy Breuillard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Josef Moravec 2019-03-11 11:20:14 UTC
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
Comment 1 Fridolin Somers 2019-03-28 09:04:59 UTC
*** Bug 22601 has been marked as a duplicate of this bug. ***
Comment 2 Fridolin Somers 2019-03-28 11:11:48 UTC
I will create a xxx-strings.inc for each js
Comment 3 Jonathan Druart 2019-06-23 15:47:06 UTC
A Koha test must be provided here.
Comment 4 Jonathan Druart 2019-12-11 09:37:54 UTC
Won't be a problem with bug 21156.
Comment 5 Jonathan Druart 2019-12-11 09:38:17 UTC
Lowering severity.
Comment 6 Fridolin Somers 2020-01-30 06:53:20 UTC
Bug 24046 fixed "Activate filters"
Comment 7 Jérémy Breuillard 2022-04-25 14:51:00 UTC Comment hidden (obsolete)
Comment 8 Jérémy Breuillard 2022-04-26 14:13:59 UTC Comment hidden (obsolete)
Comment 9 Jérémy Breuillard 2022-04-27 14:24:06 UTC Comment hidden (obsolete)
Comment 10 Jérémy Breuillard 2022-04-28 07:50:04 UTC Comment hidden (obsolete)
Comment 11 Jérémy Breuillard 2022-04-28 09:16:45 UTC
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
Comment 12 Josef Moravec 2022-05-20 06:43:00 UTC
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