Amir Karimi
Amir Karimi

Reputation: 5521

Set locale just for Active Admin

I've set my default application locale to :fa but I want Active Admin to use :en as its locale.

I set default_locale to :fa:

  class Application < Rails::Application
    config.i18n.default_locale = :fa
    config.assets.enabled = true
    config.assets.paths << "#{Rails.root}/app/assets/fonts" 
  end

But I don't know where can I change the locale for Active Admin?

Upvotes: 3

Views: 2581

Answers (1)

nistvan
nistvan

Reputation: 2960

You can use before_filter to set default_locale: https://github.com/gregbell/active_admin/wiki/Switching-locale

In your filter you can determine the namespace: params[:controller].split("/").first

Upvotes: 3

Related Questions