Module: Typus::Locale

Included in:
Admin::MasterController, TypusController
Defined in:
lib/typus/locale.rb

Instance Method Summary collapse

Instance Method Details

#set_localeObject



5
6
7
8
9
10
11
12
13
# File 'lib/typus/locale.rb', line 5

def set_locale
  if params[:locale]
    I18n.locale = params[:locale]
    session[:typus_locale] = params[:locale]
    redirect_to :back
  else
    I18n.locale = session[:typus_locale] || Typus.default_locale
  end
end