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

i18n-tasks 0.9.28 forces I18n.enforce_available_locales to 'false' regardless of initial setting #315

Closed
tjgrathwell opened this issue Nov 9, 2018 · 3 comments
Labels
Milestone

Comments

@tjgrathwell
Copy link

In the most recent version, loading the 'i18n/tasks' file forces I18n.enforce_available_locales to false

This caused an order-dependent test failure in our build since we load i18n/tasks late and have some other tests that depend on I18n.enforce_available_locales being true.

I think the gem should be changed to ensure enforce_available_locales remains whatever the original value was. But I don't know why the gem is setting it to true, so I can't propose a precise solution. If enforce_available_locales need to be off for some tests or features, the toggling of it should probably be in those tests or features rather than globally.

@glebm
Copy link
Owner

glebm commented Nov 10, 2018

It's set to false here, I'm not sure why:

I18n.enforce_available_locales = false

@Gargron Please have a look

@Gargron
Copy link
Contributor

Gargron commented Nov 11, 2018

We are retrieving pluralization data for various language files, but without that line, I18n complains that those languages are not available. Pluralization is, I believe, the only case of us using I18n.t, so the problem does not come up in other cases. The reason as I understand it is that while we load all language files of the underlying application, we don't set the available locales anywhere.

@glebm
Copy link
Owner

glebm commented Nov 11, 2018

Can we restore enforce_available_locales after loading?

@glebm glebm added this to the v0.9.29 milestone Mar 31, 2019
@glebm glebm added the bug label Mar 31, 2019
@glebm glebm closed this as completed in f6be556 Mar 31, 2019
glebm added a commit that referenced this issue Mar 31, 2019
Only load pluralization data.
Fixes #315
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

3 participants