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,18 +31,24 @@ class text {
$text = array();
//get the global app_languages.php so we can get the list of languages
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
unset($text['language-name']['en-us']);
if (is_array($text['language-name'])) {
$languages = array_keys($text['language-name']);
asort($languages);
array_unshift($languages, 'en-us');
}
//support legacy variable
if (is_array($languages)) {
$_SESSION['app']['languages'] = $languages;
$this->languages = $languages;
}
}
/**
* Called when there are no references to a particular object