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

Lang.choice with fallback uses wrong plural form #64

Closed
nanaya opened this issue Dec 22, 2017 · 2 comments
Closed

Lang.choice with fallback uses wrong plural form #64

nanaya opened this issue Dec 22, 2017 · 2 comments
Labels

Comments

@nanaya
Copy link
Contributor

nanaya commented Dec 22, 2017

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
@rmariuzzo
Copy link
Owner

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

@rmariuzzo rmariuzzo added the bug label Dec 22, 2017
rmariuzzo added a commit that referenced this issue Dec 22, 2017
This broken test was added thanks to @nanaya as reported in #64.
rmariuzzo added a commit that referenced this issue Dec 22, 2017
This broken test was added thanks to @nanaya as reported in #64.
@rmariuzzo
Copy link
Owner

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

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

No branches or pull requests

2 participants