From 17b34351f4f234a945764e479ede6d1ccd517c80 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Wed, 28 May 2014 16:48:24 +0200 Subject: [PATCH] Set I18n language on the request even if the session is expired --- app/controllers/application_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8b7bff5..cf70cd5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -61,6 +61,11 @@ class ApplicationController < ActionController::Base def session_expiration if session[:user_id] if session_expired? && !try_to_autologin + if session[:user_id] && user = User.active.find_by_id(session[:user_id]) && user.logged? + lang = find_language(user.language) + end + set_language_if_valid(lang || Setting.default_language) + reset_session flash[:error] = l(:error_session_expired) redirect_to signin_url -- 1.9.3