This commit is contained in:
Paula Quispe
2019-10-10 14:38:22 -04:00
parent e637c6e4f1
commit 682b07e6a5
2 changed files with 11 additions and 2 deletions

View File

@@ -2625,13 +2625,17 @@ class Bootstrap
{
$acceptLanguage = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : 'en';
if (!defined('SYS_LANG')) {
$Translations = new \Translation;
$Translations = new Translation;
// Get the translation uploaded in the system
$translationsTable = $Translations->getTranslationEnvironments();
$inLang = false;
foreach ($translationsTable as $locale) {
// 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;
break;
}

View File

@@ -1859,6 +1859,11 @@ class Cases
$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;
}