Forum: Rails I18n Loading several locales files

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
2f6686bd2c6bb633a1cbf7b5a73c8491?d=identicon&s=25 Mickael Faivre-Macon (micktaiwan)
on 2008-12-24 10:41

If I put my 2 locales en and fr in one file (config/locales/en.yml)
english an french locales are loaded and I can switch between the two.

But if I put the french local in a separate fr.yml file, then I get
"translation missing: fr, email" errors.

My configuration.rb has:
config.i18n.load_path += Dir[File.join(RAILS_ROOT, 'config', 'locales',

Could someone explain this ?

Thanks for any help,
2f6686bd2c6bb633a1cbf7b5a73c8491?d=identicon&s=25 Mickael Faivre-Macon (micktaiwan)
on 2009-03-02 00:14
This is the solution, add this to your environment.rb.

I18n.default_locale = 'en'

LOCALES_DIRECTORY = "#{RAILS_ROOT}/config/locales"
LOCALES_AVAILABLE = Dir["#{LOCALES_DIRECTORY}/*.{rb,yml}"].collect do
  I18n.load_path << locale_file
  File.basename(File.basename(locale_file, ".rb"), ".yml")
This topic is locked and can not be replied to.