ProtonMail / WebClients

Monorepo hosting the proton web clients
GNU General Public License v3.0
4.23k stars 537 forks source link

Plural strings broken for languages with only one plural form #374

Closed b9a1 closed 2 months ago

b9a1 commented 5 months ago

We are happy to answer your questions about the code or discuss technical ideas.

Please complete the following checklist (by adding [x]):


When displayed in a language with only one plural form (currently CJK or Indonesian), all strings with plural forms will remain untranslated, no matter what the actual grammatical number is in English. This can be seen with any one of the languages aforementioned e.g. in the plan comparison table of Proton Account Dashboard, which would contain a lot of untranslated (despite having been translated on Crowdin a long time ago) numerical limits such as “3 custom email domains”.

I believe this issue has long existed since the transition to XLIFF, and the cause is incorrect string keys. Normally, a string key should be the singular form in English, for example:

https://github.com/ProtonMail/WebClients/blob/039665ece988a4dfdeaf0fe19d32c2a768944ae8/applications/account/locales/de_DE.json#L10037

But for languages with only one plural form, the string key takes the English plural form:

https://github.com/ProtonMail/WebClients/blob/039665ece988a4dfdeaf0fe19d32c2a768944ae8/applications/account/locales/zh_CN.json#L9021

Is it possible for proton-i18n to somehow produce correct keys from XLIFF files generated by Crowdin?

dhoko commented 5 months ago

Hello 👋

A fix has been merged. It's going to be available inside this repo soon (a few days). Thx for the report 🔥 🙏

I believe this issue has long existed since the transition to XLIFF, and the cause is incorrect string keys

Yep inside the export from crowdin the version for 1 is gone, we bring it back when we create the JSON thx to the resname.

b9a1 commented 3 months ago

There seems to be a regression. All plural translations for CJK and Indonesian have been removed from the JSON files since March 12.

dhoko commented 3 months ago

There was a silent issue inside a linked service required to build translations 😨 Patched and strings fixed. Update should be visible soon inside the repo. Thx for the report 🙏

dhoko commented 2 months ago

voilà https://github.com/ProtonMail/WebClients/commit/e0a070ba62085fd1971c59e3c69064c48bb9ffc1#diff-bff598cd255b72349e859c049816fa1fb80501f66fbe9d7e4a893fa55c0ae2b6