vladCovaliov
vladCovaliov

Reputation: 4403

i18n rails get translations from two different yml files

I am using tolk for translation, but tolk takes all my values from en.yml and dumpes them in es.yml overwriting the existing content .

There are some stuff i don't want to be overwritten , so when i am searching for the es translations, i want rails to look in both es.yml and es.defaults.yml

( and so, i can keep isolated what i generate with tolk, and what remais the same )

Is there a way i can do this?

Thanks

Upvotes: 0

Views: 1768

Answers (1)

Jaap Haagmans
Jaap Haagmans

Reputation: 6332

Rails loads every file in the config/locales/ directory, so it will probably already work like you're suggesting. You can even organize it further than that, according to the I18n Guide:

http://guides.rubyonrails.org/i18n.html#organization-of-locale-files

However, I think that with duplicate key structures, Rails will probably override the values of the earlier loaded (sorted by file name) locale file with the values of the later loaded file. So please try to avoid duplicate keys.

Upvotes: 2

Related Questions