mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
added support to name the languages
added remaining flags i have from the famfamfam set and renamed them to country names
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Get the text for the correct translation
|
||||
*
|
||||
* @method array get
|
||||
*/
|
||||
class text {
|
||||
|
||||
/**
|
||||
* Called when the object is created
|
||||
*/
|
||||
public function __construct() {
|
||||
//place holder
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when there are no references to a particular object
|
||||
* unset the variables used in the class
|
||||
@@ -23,7 +20,6 @@ class text {
|
||||
unset($this->$key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a specific item from the cache
|
||||
* @var string $language_code examples: en-us, es-cl, fr-fr, pt-pt
|
||||
@@ -39,7 +35,6 @@ class text {
|
||||
else {
|
||||
include getcwd().'/app_languages.php';
|
||||
}
|
||||
|
||||
//get the available languages
|
||||
krsort($text);
|
||||
foreach ($text as $lang_label => $lang_codes) {
|
||||
@@ -50,7 +45,6 @@ class text {
|
||||
}
|
||||
}
|
||||
$_SESSION['app']['languages'] = array_unique($app_languages);
|
||||
|
||||
//check the session language
|
||||
if(isset($_SESSION['domain'])){
|
||||
$language_code = $_SESSION['domain']['language']['code'];
|
||||
@@ -63,12 +57,20 @@ class text {
|
||||
$text[$key] = $value[$language_code];
|
||||
}
|
||||
}
|
||||
|
||||
if ($language_code != 'all') {
|
||||
foreach($language_name as $code => $value) {
|
||||
$text["language-$code"] = $value;
|
||||
}
|
||||
}else{
|
||||
foreach($language_name as $code => $value) {
|
||||
foreach($language_name as $c_code => $value) {
|
||||
$text["language-$code"][$c_code] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//return the array of translations
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user