> José, I worry about the performance for the same reasons you do.  Best
> I could do is to cache the fallback_chain so it's only calculated once
> (per instance).  But I agree, performance will be twice as bad on
> average since most keys will be in the broader locale.

Kip, my point about performance is that you can merge locales when the
enviroment is loaded.
For example, if you have both "en-UK" and "en" locales, when your
Rails application starts you could do:

  en_uk_locale = en_locale.deep_merge(en_uk_locale)

Then you will have all keys in "en-UK" locale and won't have to search
in "en" locale.

I18n backend already have a method called merge_translations that does
a deep_merge.
So it probably won't need a lot of changes.

--
José Valim
http://josevalim.blogspot.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"rails-i18n" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rails-i18n?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to