From 7e42e4c45f9521139a59f5d637e4c7aed0363654 Mon Sep 17 00:00:00 2001 From: Pinga <121483313+getpinga@users.noreply.github.com> Date: Wed, 20 Nov 2024 13:12:32 +0200 Subject: [PATCH] Added ability to change the default language in CP --- cp/bootstrap/app.php | 8 ++++---- cp/env-sample | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cp/bootstrap/app.php b/cp/bootstrap/app.php index cd194ee..3dc4517 100644 --- a/cp/bootstrap/app.php +++ b/cp/bootstrap/app.php @@ -99,12 +99,12 @@ $container->set('view', function ($container) { $uiLang = strtolower($parts[1]); } } else { - $desiredLanguage = 'en_US'; - $uiLang = 'us'; + $desiredLanguage = envi('LANG'); + $uiLang = envi('UI_LANG'); } } else { - $desiredLanguage = 'en_US'; - $uiLang = 'us'; + $desiredLanguage = envi('LANG'); + $uiLang = envi('UI_LANG'); } $lang_full = Language::getName($desiredLanguage, 'en'); $lang = trim(strstr($lang_full, ' (', true)); diff --git a/cp/env-sample b/cp/env-sample index 957b270..2a9394b 100644 --- a/cp/env-sample +++ b/cp/env-sample @@ -5,6 +5,9 @@ APP_DOMAIN=example.com APP_ROOT=/var/www/cp MINIMUM_DATA=false +LANG=en_US +UI_LANG=us + DB_DRIVER=mysql DB_HOST=localhost DB_DATABASE=registry