rmariuzzo/Lang.js

Lang.choice with fallback uses wrong plural form

Closed this issue · 2 comments

When using fallback for translation, choice still uses the current locale for pluralForm, causing wrong rule being used.

> Lang.messages['en.test'] = ':count box|:count boxes'
> Lang.setFallback('en')
> Lang.setLocale('pl')
> Lang.choice('test', 1)
"1 box"
> Lang.choice('test', 2)
"2 boxes"
> Lang.choice('test', 10)
undefined

@nanaya thank you for reporting this issue. I will take a look and make a fix.

Hey @nanaya! I'm glad to tell you that the issue that you reported was fixed: https://github.com/rmariuzzo/Lang.js/releases/tag/v1.1.12