Skip to content
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

Support floating numbers for plurals translation #332

Open
alextrs opened this issue Sep 20, 2017 · 0 comments
Open

Support floating numbers for plurals translation #332

alextrs opened this issue Sep 20, 2017 · 0 comments

Comments

@alextrs
Copy link

alextrs commented Sep 20, 2017

I'm trying to make floating numbers to work with plurals translation. Was looking for a while and then realized that library doesn't support it at this point. I pulled "make-plural" library and if I pass 0.5 it returns "other" which makes sense, but i18nTranslatePlural MakePlural returns "many". After digging a bit more, I found that it happens because of parseInt statement on line 358 in i18n.js (so 0.5 becomes 0 -> "many").

If it makes sense to change from parseInt to parseFloat I will be happy to make this change.

I have in JSON:
"%s tablespoon": {
"one": "столовая ложка",
"few": "столовых ложки",
"many": "столовых ложек",
"other": "столовой ложки"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant