i18n-node icon indicating copy to clipboard operation
i18n-node copied to clipboard

Support floating numbers for plurals translation

Open alextrs opened this issue 8 years ago • 0 comments

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": "столовой ложки" }

alextrs avatar Sep 20 '17 04:09 alextrs