xpepermint
xpepermint

Reputation: 36273

Ruby on Rails Internationalization

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!

Upvotes: 2

Views: 1036

Answers (1)

xpepermint
xpepermint

Reputation: 36273

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.

Upvotes: 2

Related Questions