Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#1048

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 I18n: move old-style interpolation syntax deprecation to activerecord being applied. Maybe it's easier to pull from my fork instead: http://github.com/svenfuchs/rail...

Reported by Sven Fuchs · September 15th, 2008 @ 09:38 AM

State: resolved
Milestone: 2.x
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Sven Fuchs
  2. Repository
    Repository
    • State changed from new to resolved
    • Tag changed from i18n, patch to i18n, patch

    (from [a3b7fa78bfdc33e45e39c095b67e02d50a2c7bea]) I18n: Introduce I18n.load_path in favor of I18n.load_translations and change Simple backend to load translations lazily. [#1048 I18n: introduce I18n.load_path in favor of I18n.load_translations and change ... state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    September 20th, 2008 @ 07:27 PM

  3. Sven Fuchs