From 7e629d7ef4d2d7b27e57f609ad68ef8e19e9ad87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Aug 2020 14:05:05 +0200 Subject: [PATCH] FIX Language visible just after login does not match user choice. --- htdocs/main.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 396e377e7b5..2887b4b1f77 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -655,6 +655,11 @@ if (!defined('NOLOGIN')) if (GETPOST('lang', 'aZ09')) $paramsurl[] = 'lang='.GETPOST('lang', 'aZ09'); header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : '')); exit; + } else { + // User is loaded, we may need to change language for him according to its choice + if (! empty($user->conf->MAIN_LANG_DEFAULT)) { + $langs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); + } } } else