Class: Underworld::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Includes:
Pundit
Defined in:
app/controllers/underworld/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#set_localeObject



7
8
9
10
11
12
13
14
15
# File 'app/controllers/underworld/application_controller.rb', line 7

def set_locale
  if I18n.available_locales.length > 1
    lang = request.env['lang'] || params[:locale] || session[:locale] || I18n.default_locale
  else
    lang = I18n.default_locale
  end

  session[:locale] = I18n.locale = :"#{lang}"
end