13 lines
339 B
Ruby
13 lines
339 B
Ruby
class ApplicationController < ActionController::Base
|
|
around_action :switch_locale
|
|
|
|
def switch_locale(&action)
|
|
locale = I18n.locale_available?(request.headers['Locale']) ? request.headers['Locale'] : I18n.default_locale
|
|
I18n.with_locale(locale, &action)
|
|
end
|
|
|
|
def new_session_path(_scope)
|
|
new_user_session_path
|
|
end
|
|
end
|