Reputation: 41
I have a rails 4.0.2 app which uses I18N. The config/application.rb file states that
the default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
But when I add app.en.yml and app.fr.yml to the config/locales folder, none of the two files appear in I18n.load_path, unless I add the following line to config/application.rb:
config.i18n.load_path += Dir[Rails.root.join("config", "locales", "app.*.{rb,yml}").to_s]
Is there something I'm missing?
Thanks
Upvotes: 4
Views: 1607
Reputation: 16507
Seems your i18n files may lost after hot-reload by Rails engine, i.e. has affected only first time. You are also able to make sure what files are loaded in Rails console rails c
as:
Rails.configuration.i18n.load_path
Upvotes: 0