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

rebased version of #261

Copy link
Collaborator

@radar radar left a comment

Choose a reason for hiding this comment

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

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

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

@radar updated PR

@radar
Copy link
Collaborator

radar commented Nov 9, 2017

LGTM! Thanks!

@radar radar merged commit 4e9b237 into ruby-i18n:master Nov 9, 2017
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 pushed 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
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request 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 December 15, 2021 15:55
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