Added error messages translations to white ips

This commit is contained in:
Sergei Tsoganov 2023-07-04 11:33:06 +03:00
parent 289159bff2
commit 97c11f5dfd
7 changed files with 161 additions and 50 deletions

View file

@ -1,6 +1,7 @@
module Admin
class BaseController < ApplicationController
before_action :authenticate_admin_user!
before_action :set_locale
helper_method :head_title_sufix
before_action :set_paper_trail_whodunnit
@ -33,5 +34,9 @@ module Admin
end
end
end
def set_locale
I18n.locale = params[:locale] || I18n.default_locale
end
end
end

View file

@ -5,6 +5,7 @@ module Repp
around_action :log_request
before_action :authenticate_user
before_action :set_locale
before_action :validate_webclient_ca
before_action :validate_client_certs
before_action :check_ip_restriction
@ -176,6 +177,10 @@ module Repp
authorize!(:throttled_user, @domain) unless current_user || action_name == 'tara_callback'
current_user
end
def set_locale
I18n.locale = current_user&.try(:locale) || params[:locale] || I18n.default_locale
end
end
end
end