Hi,
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',
'*.{rb,yml}')]
Could someone explain this ?
Thanks for any help,
Mickael.
on 2008-12-24 10:41
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
|locale_file|
I18n.load_path << locale_file
File.basename(File.basename(locale_file, ".rb"), ".yml")
end.uniq.sort
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.