module MnoEnterprise::Concerns::Controllers::I18n

Add a before_filter to set the locale based on the params or the default locale

Public Instance Methods

set_locale() click to toggle source
# File lib/mno_enterprise/concerns/controllers/i18n.rb, line 9
def set_locale
  I18n.locale =  if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
    params[:locale]
  else
    I18n.default_locale
  end
end