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

Don't store translations for locales not set as available #391

Conversation

@stereobooster
Copy link
Contributor

@stereobooster stereobooster commented Nov 3, 2017

rebased version of #261

@stereobooster stereobooster force-pushed the stereobooster:dont-store-tr-for-locales-not-set-as-available branch from f64088a to 5077ef9 Nov 3, 2017
Copy link
Collaborator

@radar radar left a comment

One small change and then I think this is good to go. Thanks for rebasing it!

@@ -29,6 +29,11 @@ def initialized?
# translations will be overwritten by new ones only at the deepest
# level of the hash.
def store_translations(locale, data, options = {})
if I18n.available_locales_initialized? &&
I18n.available_locales.include?(locale.to_sym) == false &&

This comment has been minimized.

@radar

radar Nov 8, 2017
Collaborator

Please use !I18n.available_locales.include?(locale.to_sym) here instead of == false.

@stereobooster
Copy link
Contributor Author

@stereobooster stereobooster commented Nov 8, 2017

@radar updated PR

@radar
radar approved these changes Nov 9, 2017
@radar
Copy link
Collaborator

@radar radar commented Nov 9, 2017

LGTM! Thanks!

@radar radar merged commit 4e9b237 into ruby-i18n:master Nov 9, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
tagliala added a commit to tagliala/faker that referenced this pull request Jan 27, 2018
Starting from version 0.9.3, I18n doesn't store translations for locales
not set as available.

This change set locales as available before storing translations.

Fix: faker-ruby#1132

Ref: ruby-i18n/i18n#391
@clemens clemens mentioned this pull request Jan 27, 2018
mshibuya added a commit to carrierwaveuploader/carrierwave that referenced this pull request Feb 10, 2018
I18n.available_locales needs to be cleared before storing translations: ruby-i18n/i18n#391
tagliala added a commit to tagliala/faker that referenced this pull request May 20, 2018
Starting from version 0.9.3, I18n doesn't store translations for locales
not set as available.

This change set locales as available before storing translations.

Fix: faker-ruby#1132

Ref: ruby-i18n/i18n#391
tagliala added a commit to tagliala/faker that referenced this pull request Jun 21, 2018
Starting from version 0.9.3, I18n doesn't store translations for locales
not set as available.

This change set locales as available before storing translations.

Fix: faker-ruby#1132

Ref: ruby-i18n/i18n#391
stympy added a commit to faker-ruby/faker that referenced this pull request Jun 21, 2018
Starting from version 0.9.3, I18n doesn't store translations for locales not set as available.

This change set locales as available before storing translations.

Fix: #1132

Ref: ruby-i18n/i18n#391
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants