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

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 &&
Copy link
Collaborator

@radar radar Nov 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@stereobooster
Copy link
Contributor Author

stereobooster commented Nov 8, 2017

@radar updated PR

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

radar commented Nov 9, 2017

LGTM! Thanks!

@radar radar merged commit 4e9b237 into ruby-i18n:master Nov 9, 2017
1 check passed
tagliala added a commit to tagliala/faker that referenced this issue 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 issue 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 issue 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 issue 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 pushed a commit to faker-ruby/faker that referenced this issue 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
davidmorton0 pushed a commit to davidmorton0/faker that referenced this issue Jul 12, 2021
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
@stereobooster stereobooster deleted the dont-store-tr-for-locales-not-set-as-available branch Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants