# Rails 2.3.9 i18n - multiple yml files

**URL:** <https://www.ruby-forum.com/t/rails-2-3-9-i18n-multiple-yml-files/195670>\
**Category:** Rails I18n\
**Created:** [September 27, 2010, 11:01pm UTC](https://www.ruby-forum.com/t/rails-2-3-9-i18n-multiple-yml-files/195670 "2010-09-27T23:01:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimptoc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3d9bf3/32.png) [@kimptoc](https://www.ruby-forum.com/u/kimptoc)\
**Post date:** [September 27, 2010, 11:01pm UTC](https://www.ruby-forum.com/t/rails-2-3-9-i18n-multiple-yml-files/195670/1 "2010-09-27T23:01:01Z")

</div>

Hi,

Have been following the i18n guide (

> **[Rails Internationalization (I18n) API — Ruby on Rails Guides](https://guides.rubyonrails.org/i18n.html)**
>
> Rails Internationalization (I18n) APIThe Ruby I18n (shorthand for internationalization) gem which is shipped with Ruby on Rails (starting from Rails 2.2) provides an easy-to-use and extensible framework for translating your application to a single...

)

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,  
right?

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 ( [GitHub - clemens/i18n\_demo\_app: Demo application to show Rails' new i18n features](http://github.com/clemens/i18n_demo_app)  
), but thats a bit old now and does not use nested/merged localisation  
dictionaries.

Any thoughts on where I am going wrong?

Thanks in advance,  
Chris

---

<div class="post-metadata">

**Author:** ![kimptoc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3d9bf3/32.png) [@kimptoc](https://www.ruby-forum.com/u/kimptoc)\
**Post date:** [September 28, 2010, 9:25am UTC](https://www.ruby-forum.com/t/rails-2-3-9-i18n-multiple-yml-files/195670/2 "2010-09-28T09:25:30Z")

</div>

Can you show us a Gist or [pastie.org](http://pastie.org) with your .yml files?

---

<div class="post-metadata">

**Author:** ![kimptoc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3d9bf3/32.png) [@kimptoc](https://www.ruby-forum.com/u/kimptoc)\
**Post date:** [September 28, 2010, 10:37am UTC](https://www.ruby-forum.com/t/rails-2-3-9-i18n-multiple-yml-files/195670/3 "2010-09-28T10:37:32Z")

</div>

Hi,

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

> **[GitHub - kimptoc/Rails-i18n-sample-with-multiple-merged-yml-files: Rails i18n...](https://github.com/kimptoc/Rails-i18n-sample-with-multiple-merged-yml-files)**
>
> Rails i18n sample with multiple merged yml files. Contribute to kimptoc/Rails-i18n-sample-with-multiple-merged-yml-files development by creating an account on GitHub.

But that works… doh!

Guess I need to look at my main app again.

Apologies for wasting your time,  
Chris
