You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In other words, if the first read is performed with available_locales_set set to only en, non-en locales files will be ignored.
And no further reading of locale files will be performed.
Workaround
Run I18n.eager_load! before available_locales_set is updated.
# config/initializers/i18n.rbRails.application.config.after_initialize{I18n.eager_load!}# or config.eager_load = true
Assumption
config.eager_load = true
(I18n.eager_load!
don't run ).config.i18n.default_locale = :ja
( Locale other thanen
)Steps to reproduce
I18n.l(Time.current)
Translation missing: ja.time.formats.default (I18n::MissingTranslationData)
Smaller reproduction code
I think it is a bug related to ca09138.
First, I18n file reading is performed only once.
https://github.com/ruby-i18n/i18n/blob/4dddd855039b0c5a0b5b3b2df69783374058a7c9/lib/i18n/backend/simple.rb#L28-L30
Next, non-valid locale files are ignored.
https://github.com/ruby-i18n/i18n/blob/4dddd855039b0c5a0b5b3b2df69783374058a7c9/lib/i18n/backend/simple.rb#L37-L40
In other words, if the first read is performed with available_locales_set set to only en, non-en locales files will be ignored.
And no further reading of locale files will be performed.
Workaround
Run
I18n.eager_load!
before available_locales_set is updated.The text was updated successfully, but these errors were encountered: