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