-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i18next-json-sync used in i18n:sync-keys script removes correct plurals from translations #175
Comments
Good catch, seems like this is an issue with the cli we use: jwbay/i18next-json-sync#22 I'll check out the alternative mentioned in the thread and see if we can migrate to it. |
The alternative is even worse in a brief test 😅 ... guess we need to roll our own here. |
Ok, I dug deep into this while checking your new script's output...maybe too deep :D Sorry for massive amount of text... First of all, I will write from my perspective what I would expect while syncing original English file to my locale:
So, for example: #en.json
"key1_one": "one",
"key2_one": "two",
"key2_other": "two_other",
"nonplural_key": "nonplkey" #pl.json
"key1_one": "one_pl",
"key1_few": "one_few_pl",
"key1_many": "one_many_pl",
"key1_other": "one_other_pl",
"key2": "two_pl",
"key2_other": "two_other_pl" I expect after syncing: #pl.json
"key1_one": "one_pl",
"key1_few": "one_few_pl",
"key1_many": "one_many_pl",
"key1_other": "one_other_pl",
-"key2": "two_pl",
+"key2_one": "two",
+"key2_few": "two_other",
+"key2_many": "two_other",
"key2_other": "two_other_pl",
+"nonplural_key": "nonplkey" I was looking for this behavior on locales there are right now available on the app on For me it looks like the #180 script as far I can tell, leaves all translated suffixes as is, but do not add them based on target locale. Of course it is up to expectations - your script is undoubtedly better than the original |
Oh shoot, I did took me so long that you already did that 😅 Hope that whatever I wrote is still somehow relevant xD |
@javnik36 yeah it's relevant, thanks for the deep dive and opening an issue on the locales project. It mangled the ko locale for me as well, but I did not look into it further. 😅 I see your point re: creating the plurals automatically, that would be ideal. Can you ping back here once the issue gets solved upstream? I think the DX issue with adding locales we can solve quite easily with a wrapper script that reads the LOCALES constant. |
btw in the mean-time, another PR was opened that relates to this #181 - yesterday I learned that russian plurals are quite special, so I think this is relevant for more locales than pl. |
Sure thing, will let you know. Oh yeah, I discovered today that formally in pl we have more plurals than I though - in some cases plural for fraction numbers can be different than any other 😅 (though I have no idea if 18next supports that). |
Not the bug with the app itself, but worth noting imo. Running
i18n:sync-keys
script removes correct plural forms from translations.E.g. polish has 3 plural forms - so adding them manually to the translation json and running the script afterwards will remove them if they were never present in English original. Git diff as example:

Not entirely sure what is going wrong in this case - my manual additions, module used in the script or something else 😆 .
The text was updated successfully, but these errors were encountered: