FEATURE: Load translation overrides without JS eval

This commit is contained in:
Gerhard Schlager
2019-11-05 02:15:44 +01:00
parent ca6adfbdd6
commit 61b1f9c36b
14 changed files with 181 additions and 87 deletions

View File

@@ -137,9 +137,10 @@ module I18n
def overrides_by_locale(locale)
return unless @overrides_enabled
return {} if GlobalSetting.skip_db?
execute_reload if @requires_reload
site = RailsMultisite::ConnectionManagement.current_db
by_site = @overrides_by_site[site]
@@ -170,11 +171,6 @@ module I18n
end
end
def client_overrides_json(locale)
client_json = (overrides_by_locale(locale) || {}).select { |k, _| k[/^(admin_js|js)\./] }
MultiJson.dump(client_json)
end
def translate(*args)
execute_reload if @requires_reload