Refactor to our own Discourse I18n backend

This removes some monkey patches and makes testing easier.
It will also support database backed I18n changes.
This commit is contained in:
Robin Ward
2015-11-13 16:35:02 -05:00
parent 43614439e6
commit 3720783c1b
8 changed files with 103 additions and 123 deletions
+2 -7
View File
@@ -138,13 +138,8 @@ class ApplicationController < ActionController::Base
end
def set_locale
I18n.locale = if current_user
current_user.effective_locale
else
SiteSetting.default_locale
end
I18n.fallbacks.ensure_loaded!
I18n.locale = current_user.try(:effective_locale) || SiteSetting.default_locale
I18n.ensure_all_loaded!
end
def store_preloaded(key, json)
+1 -1
View File
@@ -149,7 +149,7 @@ module Jobs
begin
RailsMultisite::ConnectionManagement.establish_connection(db: db)
I18n.locale = SiteSetting.default_locale
I18n.fallbacks.ensure_loaded!
I18n.ensure_all_loaded!
begin
execute(opts)
rescue => e