-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Bug: Incorrect translation when using numbers as keys #72
Comments
The problem seems to be in lodash's It's also order dependent when storing translations, because if you do it separately, it works: i18n.store({ en: { units: { l: "liter" } } });
i18n.store({ en: { units: { "1": "number" } } }); I guess we can detect whether the key is a string; if so, forcefully use an object rather than an array. |
fnando
added a commit
that referenced
this issue
Sep 9, 2023
5 tasks
fnando
added a commit
that referenced
this issue
Sep 9, 2023
fnando
added a commit
that referenced
this issue
Sep 9, 2023
fnando
added a commit
that referenced
this issue
Sep 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
We use i18n-js with translations for units and we request the translations of the entire set of units. This used to work in previous versions but after switching to version 4 this results in a incomplete array. When we remove '1' key the problem is solved.
Thank you for your great work on this package!
How to reproduce
What do you expect
Expected this console output:
This is also what version 3.9.2 of i18n-js returned (using a similar setup).
What happened instead
This console output:
Software:
The text was updated successfully, but these errors were encountered: