CMXX - Language selection

This commit is contained in:
“VeLiTi”
2025-02-19 16:48:48 +01:00
parent 0e9d133ff9
commit 8bb78d2a08
19 changed files with 139 additions and 58 deletions

View File

@@ -17,7 +17,36 @@ session_start();
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
include './custom/settings/config.php';
include 'functions.php';
include './custom/translations/translations_'.strtoupper(language_code).'.php';
//TRANSLATION FILE LOCATION
if (isset($_GET['language']) && $_GET['language'] !=''){
//INCLUDE LANGUAGE FILE
$file_language = './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';
if (file_exists($api_file_language)){
include $file_language; //Include the code
//DEFINE LANGUAGE
$_SESSION['country_code'] = trim($_GET['language']);
}
else {
include './custom/translations/translations_US.php';
//DEFINE LANGUAGE
$_SESSION['country_code'] = language_code;
}
}
elseif(isset($_SESSION['country_code'])){
$file_language = './settings/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';
if (file_exists($file_language)){
include $file_language; //Include the code
}
else {
include './custom/translations/translations_US.php';
}
} else {
include './custom/translations/translations_US.php';
//DEFINE LANGUAGE
$_SESSION['country_code'] = language_code;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
//LOGIN TO API