views:

231

answers:

1

Hey, I try to make my config/locals organized in directories like the app directory. I can not get this to work... Here http://guides.rubyonrails.org/i18n.html says you have to activate this manually under config like this

config.i18n.load_path += Dir[File.join(RAILS_ROOT, 'config', 'locales', '**', '*.{rb,yml}')]

but when I try to use my constant in a view a get an error (missing/nil). Can someone write an example step by step? 10thx!

A: 

Found the solution. I found out I did everything right :).

You have to add this

config.i18n.load_path += Dir[File.join(RAILS_ROOT, 'config', 'locales', '**', '*.{rb,yml}')]

to the config/locales/environment.rb and then you can use whatever directory structure you want.

xpepermint