This project is archived and is in readonly mode.

#1048 ✓resolved
Sven Fuchs

I18n: introduce I18n.load_path in favor of I18n.load_translations and change Simple backend to load translations lazily

Reported by Sven Fuchs | September 15th, 2008 @ 09:38 AM | in 2.x

Rails libraries announce their translation files to the I18n library when they're loaded during Rails init process. So far the translations are immediately loaded by the backend which makes it hard to swap the backend after the Rails libraries have been loaded (e.g. custom initializer or plugin).

We've discussed various options to solve this and we believe that the best solution is to remove #load_translations from I18n in favor of a #load_path array which only collects the announced translation sources. The Simple backend can then lazy-load the translations at the latest possible point, i.e. before the first lookup happens.

The attached patch should apply but might rely on #1044 being applied. Maybe it's easier to pull from my fork instead: http://github.com/svenfuchs/rail...

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Tags

Referenced by

Pages