mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03: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
|
// Workarounds for the changed application structure
|
||||||
if ('webmail' === $sSectionKey) {
|
if ('webmail' === $sSectionKey) {
|
||||||
if ('language_admin' === $sSectionKey) {
|
if ('language_admin' === $sParamKey) {
|
||||||
$sSectionKey = 'admin_panel';
|
$sSectionKey = 'admin_panel';
|
||||||
$sParamKey = 'language';
|
$sParamKey = 'language';
|
||||||
}
|
}
|
||||||
|
|
@ -137,6 +137,16 @@ class Application extends \RainLoop\Config\AbstractConfig
|
||||||
$sParamKey = 'json_response_write_limit';
|
$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);
|
parent::Set($sSectionKey, $sParamKey, $mParamValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue