mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 09:02:45 +08:00
Bugfix: default language error
https://github.com/the-djmaze/snappymail/issues/1579#issuecomment-2134782450
This commit is contained in:
parent
dd39d18e2a
commit
998eb8c4bb
1 changed files with 11 additions and 1 deletions
|
@ -96,7 +96,7 @@ class Application extends \RainLoop\Config\AbstractConfig
|
|||
{
|
||||
// Workarounds for the changed application structure
|
||||
if ('webmail' === $sSectionKey) {
|
||||
if ('language_admin' === $sSectionKey) {
|
||||
if ('language_admin' === $sParamKey) {
|
||||
$sSectionKey = 'admin_panel';
|
||||
$sParamKey = 'language';
|
||||
}
|
||||
|
@ -137,6 +137,16 @@ class Application extends \RainLoop\Config\AbstractConfig
|
|||
$sParamKey = 'json_response_write_limit';
|
||||
}
|
||||
}
|
||||
if ('language' === $sParamKey) {
|
||||
$aLang = \SnappyMail\L10n::getLanguages('admin_panel' === $sSectionKey);
|
||||
$sLanguage = \strtr($mParamValue, '_', '-');
|
||||
if (!\in_array($sLanguage, $aLang)) {
|
||||
if (\str_contains($sLanguage, '-')) {
|
||||
$sLanguage = \strtok($sLanguage, '-');
|
||||
}
|
||||
}
|
||||
$mParamValue = \in_array($sLanguage, $aLang) ? $sLanguage : 'en';
|
||||
}
|
||||
parent::Set($sSectionKey, $sParamKey, $mParamValue);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue