Skip to content
jpmckinney edited this page Jul 1, 2012 · 4 revisions

You just need to set I18n.locale in a before_filter.

Add the following line to config/initializers/active_admin.rb:

#config/initializers/active_admin.rb
config.before_filter :set_admin_locale

and define the folllowing method:

def set_admin_locale
  I18n.locale = :en
end

Of course, put whatever logic you want into the set_admin_locale method. If your AdminUser class has a locale field to store the user's locale, you can do:

def set_admin_locale
  I18n.locale = current_admin_user && current_admin_user.locale || I18n.default_locale
end
Clone this wiki locally