CMXX - Language selection
This commit is contained in:
31
index.php
31
index.php
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user