Forum: Rails I18n Rails 2.3.9 i18n - multiple yml files

22add8fc5caab4e188b920b0283428b0?d=identicon&s=25 kimptoc (Guest)
on 2010-09-27 23:01
(Received via mailing list)

Have been following the i18n guide (

Things are working in a basic way, using the simple backend, with my
en.yml and pt.yml locale files.

I got the core Rails Portuguese localisation from the rails-i18n
project on github.

In order to get it being used I had to copy into my pt.yml file.

However this seems to cause a clash my model specific activerecord
items - they are in the file before the defaults and so when it loads,
when it loads the standard activerecord: errors bit, it loses mine.

Fine, sounds like perhaps I should put things in separate files,

But when I put them in separate files, eg config/locales/defaults/
pt.yml - for the rails-i18n file and config/locales/pt.yml for app
specific translations.  Also adding this line to environment.rb:

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

It does not find the defaults file - I get the Symbol not found error
(due to a date lookup, missing the localised date items...)

I looked at the i18n demo app (
), but thats a bit old now and does not use nested/merged localisation

Any thoughts on where I am going wrong?

Thanks in advance,
Adce10d7f1dbabcdab8f525a59cec32f?d=identicon&s=25 Andrés Gutiérrez (andresgutgon)
on 2010-09-28 09:25
(Received via mailing list)
Can you show us a Gist or with your .yml files?
22add8fc5caab4e188b920b0283428b0?d=identicon&s=25 kimptoc (Guest)
on 2010-09-28 10:37
(Received via mailing list)

Sure - here is a sample app that has what I am trying to do in it:

But that works.. doh!

Guess I need to look at my main app again.

Apologies for wasting your time,
This topic is locked and can not be replied to.