-
Notifications
You must be signed in to change notification settings - Fork 1k
Some attempts at localisation in the JS and TS code probably don't work #15263
Copy link
Copy link
Open
Labels
Description
Strings are localised in our JavaScript and TypeScript code using a function called _(). (This is the traditional convention from open source C and C++ code that uses the GNU libraries and tools for such things.) Such function calls in the source code have a double function:
- At run-time, the _() function actually fetches the translation for its parameter
- When running
make potin the browser folder, the strings are picked up for translation and forwarded to the translation workflow. The tool that does this (xgettext) jut scans the source file and obviously only works if the _() function is called with a string literal as argument. If you call it with some other expression, like a variable, it will not be picked up for translation.
We have some dozen of cases where _() is called with something else than a string literal. They should be investigated.
Is it actually necessary to translate the strings passed to _() in each of these cases? (As the translations likely haven't worked anyway, has anybody noticed?)
- If yes, is there some low limit on how many different values can be passed to _() in these cases?
- If yes, to get them translated, it is probably enough to call _() with each of these values in some dummy code that doesn't even need to get executed, its only purpose is to forward the string to the translation workflow
- If no, we have a problem, each case needs to be individually investigated
- If no, just not pass the value through _() then
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status