mirror of
https://github.com/discourse/discourse.git
synced 2026-08-13 06:25:11 -05:00
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:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user