Refactor translations loading for current locale
This commit is contained in:
@@ -68,11 +68,9 @@ class Admin::SiteCustomization::InformationTextsController < Admin::SiteCustomiz
|
|||||||
def append_or_create_keys
|
def append_or_create_keys
|
||||||
@content = {}
|
@content = {}
|
||||||
I18n.backend.send(:init_translations) unless I18n.backend.initialized?
|
I18n.backend.send(:init_translations) unless I18n.backend.initialized?
|
||||||
translations = if params[:locale].present?
|
|
||||||
I18n.backend.send(:translations)[params[:locale].to_sym]
|
locale = params[:locale] || I18n.locale
|
||||||
else
|
translations = I18n.backend.send(:translations)[locale.to_sym]
|
||||||
I18n.backend.send(:translations)[I18n.locale.to_sym]
|
|
||||||
end
|
|
||||||
|
|
||||||
translations.each do |k, v|
|
translations.each do |k, v|
|
||||||
@content[k.to_s] = flat_hash(v).keys
|
@content[k.to_s] = flat_hash(v).keys
|
||||||
|
|||||||
Reference in New Issue
Block a user