PMC-1226
This commit is contained in:
@@ -2625,13 +2625,17 @@ class Bootstrap
|
|||||||
{
|
{
|
||||||
$acceptLanguage = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : 'en';
|
$acceptLanguage = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : 'en';
|
||||||
if (!defined('SYS_LANG')) {
|
if (!defined('SYS_LANG')) {
|
||||||
$Translations = new \Translation;
|
$Translations = new Translation;
|
||||||
// Get the translation uploaded in the system
|
// Get the translation uploaded in the system
|
||||||
$translationsTable = $Translations->getTranslationEnvironments();
|
$translationsTable = $Translations->getTranslationEnvironments();
|
||||||
$inLang = false;
|
$inLang = false;
|
||||||
foreach ($translationsTable as $locale) {
|
foreach ($translationsTable as $locale) {
|
||||||
// Check if the language used was uploaded in the Language
|
// Check if the language used was uploaded in the Language
|
||||||
if ($locale['LOCALE'] === $acceptLanguage) {
|
// The languages can defined like this : en, en-US (language-localization)
|
||||||
|
// We need to validate if the language exist it does not matter the localization
|
||||||
|
$language = explode('-', $locale['LOCALE']);
|
||||||
|
$language = head($language);
|
||||||
|
if ($language === $acceptLanguage) {
|
||||||
$inLang = true;
|
$inLang = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1859,6 +1859,11 @@ class Cases
|
|||||||
$arrayCaseVariable = array_merge($arrayCaseVariable, $dateHistory);
|
$arrayCaseVariable = array_merge($arrayCaseVariable, $dateHistory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the SYS_LANG defined, it can be updated
|
||||||
|
if (defined('SYS_LANG')) {
|
||||||
|
$arrayCaseVariable['SYS_LANG'] = SYS_LANG;
|
||||||
|
}
|
||||||
|
|
||||||
return $arrayCaseVariable;
|
return $arrayCaseVariable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user