diff --git a/app/controllers/management/base_controller.rb b/app/controllers/management/base_controller.rb index 144a28bfe..6ee5451f4 100644 --- a/app/controllers/management/base_controller.rb +++ b/app/controllers/management/base_controller.rb @@ -2,6 +2,7 @@ class Management::BaseController < ActionController::Base layout 'management' before_action :verify_manager + before_action :set_locale helper_method :managed_user @@ -19,4 +20,14 @@ class Management::BaseController < ActionController::Base @managed_user ||= Verification::Management::ManagedUser.find(session[:document_type], session[:document_number]) end + def set_locale + if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym) + session[:locale] = params[:locale] + end + + session[:locale] ||= I18n.default_locale + + I18n.locale = session[:locale] + end + end