Closed
Description
I have followed the instructions in #2837 (after bumping into the symptoms described in #3134) as follows:
# initializers/rails_admin.rb
RailsAdmin.config do |config|
config.parent_controller = "Admin::BaseController"
end
# controllers/admin/base_controller.rb
class Admin::BaseController < ApplicationController
...
end
# controllers/application_controller.rb
class ApplicationController < ActionController::Base
before_action :set_locale
def set_locale
def set_locale
if [RailsAdmin].include?(self.class.parent)
I18n.locale = :en
else
I18n.locale = get_locale_from_params || get_locale_from_user || get_locale_from_session || get_locale_from_accept || I18n.default_locale
session[:locale] = I18n.locale
current_user.update(locale: I18n.locale) if user_signed_in? and current_user.locale != I18n.locale
I18n.locale
end
end
end
Nevertheless, the locale still randomly loads into French in RailsAdmin. Would you have any idea what I am missing? Thank you very much 🙏
Metadata
Metadata
Assignees
Labels
No labels