-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Wrong locale gets randomly loaded #3140
Comments
Hi @sedubois, did you resolve this? This issue is killing me as well.. |
I think I solved this by setting |
Adding an # initializers/rails_admin.rb
RailsAdmin.config do |config|
config.parent_controller = "Admin::BaseController"
end
# controllers/admin/base_controller.rb
class Admin::BaseController < ActionController::Base
around_action :use_default_locale
private
def use_default_locale(&block)
# Executes the request with the I18n.default_locale.
# https://github.com/ruby-i18n/i18n/commit/9b14943d5e814723296cd501283d9343985fca4e
I18n.with_locale(I18n.default_locale, &block)
end
end
A couple other options for configuring the locale for a request (with examples / suggested libraries) can be found in the Rails guides. |
I have followed the instructions in #2837 (after bumping into the symptoms described in #3134) as follows:
Nevertheless, the locale still randomly loads into French in RailsAdmin. Would you have any idea what I am missing? Thank you very much 🙏
The text was updated successfully, but these errors were encountered: