Bugfix: use detected language on first login

This commit is contained in:
djmaze 2021-11-19 15:31:30 +01:00
parent a8e6aaada6
commit 4fdfd54f87

View file

@ -968,7 +968,9 @@ class Actions
if ($oSettings instanceof Settings) { if ($oSettings instanceof Settings) {
if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) { if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) {
$sLanguage = (string)$oSettings->GetConf('Language', $sLanguage); $sLanguage = (string)$oSettings->GetConf('Language',
$oConfig->Get('login', 'determine_user_language', true) ? $UserLanguageRaw : $sLanguage
);
} }
$aResult['EditorDefaultType'] = (string)$oSettings->GetConf('EditorDefaultType', $aResult['EditorDefaultType']); $aResult['EditorDefaultType'] = (string)$oSettings->GetConf('EditorDefaultType', $aResult['EditorDefaultType']);
@ -1001,8 +1003,7 @@ class Actions
} }
} }
else { else {
if ($oConfig->Get('login', 'allow_languages_on_login', true) if ($oConfig->Get('login', 'allow_languages_on_login', true) && $oConfig->Get('login', 'determine_user_language', true)) {
&& $oConfig->Get('login', 'determine_user_language', true)) {
$sLanguage = $this->ValidateLanguage($UserLanguageRaw, $sLanguage, false); $sLanguage = $this->ValidateLanguage($UserLanguageRaw, $sLanguage, false);
} }