Added ability to change the default language in CP

This commit is contained in:
Pinga 2024-11-20 13:12:32 +02:00
parent 66ce3f94ac
commit 7e42e4c45f
2 changed files with 7 additions and 4 deletions

View file

@ -99,12 +99,12 @@ $container->set('view', function ($container) {
$uiLang = strtolower($parts[1]); $uiLang = strtolower($parts[1]);
} }
} else { } else {
$desiredLanguage = 'en_US'; $desiredLanguage = envi('LANG');
$uiLang = 'us'; $uiLang = envi('UI_LANG');
} }
} else { } else {
$desiredLanguage = 'en_US'; $desiredLanguage = envi('LANG');
$uiLang = 'us'; $uiLang = envi('UI_LANG');
} }
$lang_full = Language::getName($desiredLanguage, 'en'); $lang_full = Language::getName($desiredLanguage, 'en');
$lang = trim(strstr($lang_full, ' (', true)); $lang = trim(strstr($lang_full, ' (', true));

View file

@ -5,6 +5,9 @@ APP_DOMAIN=example.com
APP_ROOT=/var/www/cp APP_ROOT=/var/www/cp
MINIMUM_DATA=false MINIMUM_DATA=false
LANG=en_US
UI_LANG=us
DB_DRIVER=mysql DB_DRIVER=mysql
DB_HOST=localhost DB_HOST=localhost
DB_DATABASE=registry DB_DATABASE=registry