FEATURE: Localization fallbacks (server-side)

The FallbackLocaleList object tells I18n::Backend::Fallbacks what order the
languages should be attempted in. Because of the translate_accelerator patch,
the SiteSetting.default_locale is *not* guaranteed to be fully loaded after the
server starts, so a call to ensure_loaded! is added after the locale is set for
the current user.

The declarations of config.i18n.fallbacks = true in the environment files were
actually garbage, because the I18n.default_locale was
SiteSetting.default_locale, so there was nothing to fall back to. *derp*
This commit is contained in:
Kane York
2015-07-15 09:04:45 -07:00
parent 728845d008
commit ecfa17b5a7
7 changed files with 31 additions and 15 deletions

View File

@ -155,6 +155,8 @@ class ApplicationController < ActionController::Base
else
SiteSetting.default_locale
end
I18n.fallbacks.ensure_loaded!
end
def store_preloaded(key, json)