Update text.php

This commit is contained in:
FusionPBX 2020-01-08 18:28:05 -07:00 committed by GitHub
parent 3774d6665c
commit 4d2d2453db
1 changed files with 12 additions and 6 deletions

View File

@ -31,17 +31,23 @@ class text {
$text = array(); $text = array();
//get the global app_languages.php so we can get the list of languages //get the global app_languages.php so we can get the list of languages
include $_SERVER["PROJECT_ROOT"]."/resources/app_languages.php"; if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/app_languages.php")) {
include $_SERVER["PROJECT_ROOT"]."/resources/app_languages.php";
}
//get the list of languages, remove en-us, sort it then put en-us in front //get the list of languages, remove en-us, sort it then put en-us in front
unset($text['language-name']['en-us']); unset($text['language-name']['en-us']);
$languages = array_keys($text['language-name']); if (is_array($text['language-name'])) {
asort($languages); $languages = array_keys($text['language-name']);
array_unshift($languages, 'en-us'); asort($languages);
array_unshift($languages, 'en-us');
}
//support legacy variable //support legacy variable
$_SESSION['app']['languages'] = $languages; if (is_array($languages)) {
$this->languages = $languages; $_SESSION['app']['languages'] = $languages;
$this->languages = $languages;
}
} }
/** /**