diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2e9b13462..e97b87cd3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -59,6 +59,7 @@ class ApplicationController < ActionController::Base end I18n.locale = locale + Globalize.locale = I18n.locale end def set_layout diff --git a/app/controllers/concerns/translatable.rb b/app/controllers/concerns/translatable.rb index 4b4b14d87..5c3b1be62 100644 --- a/app/controllers/concerns/translatable.rb +++ b/app/controllers/concerns/translatable.rb @@ -2,7 +2,6 @@ module Translatable extend ActiveSupport::Concern included do - before_action :set_translation_locale before_action :delete_translations, only: [:update] end @@ -12,10 +11,6 @@ module Translatable resource_model.globalize_attribute_names.select { |k, v| params.include?(k.to_sym) && params[k].present? } end - def set_translation_locale - Globalize.locale = I18n.locale - end - def delete_translations locales = resource_model.globalize_locales. select { |k, v| params[:delete_translations].include?(k.to_sym) && params[:delete_translations][k] == "1" } diff --git a/app/controllers/management/base_controller.rb b/app/controllers/management/base_controller.rb index be6dd66c0..bcebfebaa 100644 --- a/app/controllers/management/base_controller.rb +++ b/app/controllers/management/base_controller.rb @@ -39,6 +39,7 @@ class Management::BaseController < ActionController::Base session[:locale] ||= I18n.default_locale I18n.locale = session[:locale] + Globalize.locale = I18n.locale end def current_budget diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1f4c703b7..044697bef 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -42,6 +42,7 @@ RSpec.configure do |config| config.before do |example| DatabaseCleaner.strategy = :transaction I18n.locale = :en + Globalize.locale = I18n.locale load Rails.root.join('db', 'seeds.rb').to_s Setting["feature.user.skip_verification"] = nil end