-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Module removes all key forms from target locale if target locale uses only 1 form (no plurals) #40
Comments
Hi, thank u for reporting this issue. There is a test for this case, https://github.com/felixmosh/i18next-locales-sync/blob/master/test/syncJson/plurals.test.ts#L43 The source locale should have "room" key without any plural form, correct? |
Right, having plain "room" key in source file keeps existing plural forms in "ja" target. Although running module without plain "room" key in source, properly populates all forms in target locales - in locales that have any (e.g. targeting "pl" correctly creates all plural forms even without plain "room" key in source) in against to "ja"-like target locales (plain "room" isn't created either). |
Let me check this deeper.... |
Fixed in |
Great! That was fast, thanks for your work. Following on that issue, I have one last case (if you wish another issue created for this let me know) - creating a new locale (or updating existing one without given key) out of source locale without plain key (aka "room") does not create it in target locale, that do not use plurals. Example: // /examples/en/namespace.json
{
"room_one": "room",
"room_other": "rooms"
} Target: "ja" - does not exist, or does not contain "room" Checked on v2.1.1. |
This case doesn't make any sense, your source language most have none plural version.... What value should be used from the source? |
Please open a separate issue for this |
Describe the bug
Hey,
I guess I found that
i18next-locales-sync
has currently some problem with syncing locales with only 1 form (no plurals, like korean or japanese). When I try the example from readme:After running
npx i18next-locales-sync -p en -s ja -l ./examples
, I'm getting this:Both
room
keys are removed from targetja
file.Expected behavior
Module keeps relevant translation/key if target locale has only 1 form.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: