mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Change $language_name to $text['language-name'] this will follow current naming standards in app_languages.php and reduces code needed in the text class.
This commit is contained in:
@@ -1,31 +1,20 @@
|
||||
<?php
|
||||
|
||||
// Fill in the value in the native language
|
||||
// rename the corerct flag in /theme/flags/*.png
|
||||
|
||||
$language_name['en-us'] = "English - United States";
|
||||
$language_name['es-cl'] = "Español - Chile";
|
||||
$language_name['pt-pt'] = "Português - Portugal";
|
||||
$language_name['fr-fr'] = "Français - France";
|
||||
$language_name['nl-nl'] = "Nederlands - De Nederland";
|
||||
$language_name['pt-br'] = "Brasileiro - Português";
|
||||
$language_name['pl'] = "Polski - Polska";
|
||||
$language_name['sv-se'] = "Svenska - Sverige";
|
||||
$language_name['uk'] = "Українська - Україна";
|
||||
$language_name['de-at'] = "Deutsch - Österreich";
|
||||
$language_name['ar-eg'] = "العربية - مصر";
|
||||
$language_name['ru-ru'] = 'Русский - Россия';
|
||||
|
||||
// pl should be pl-pl
|
||||
// ro should be ro-ro
|
||||
// uk should be uk-ua
|
||||
// he should be he-il
|
||||
|
||||
// Common terms
|
||||
|
||||
//language
|
||||
$text['language-name']['en-us'] = "English - United States";
|
||||
$text['language-name']['es-cl'] = "Español - Chile";
|
||||
$text['language-name']['pt-pt'] = "Português - Portugal";
|
||||
$text['language-name']['fr-fr'] = "Français - France";
|
||||
$text['language-name']['nl-nl'] = "Nederlands - De Nederland";
|
||||
$text['language-name']['pt-br'] = "Brasileiro - Português";
|
||||
$text['language-name']['pl'] = "Polski - Polska";
|
||||
$text['language-name']['sv-se'] = "Svenska - Sverige";
|
||||
$text['language-name']['uk'] = "Українська - Україна";
|
||||
$text['language-name']['de-at'] = "Deutsch - Österreich";
|
||||
$text['language-name']['ar-eg'] = "العربية - مصر";
|
||||
$text['language-name']['ru-ru'] = 'Русский - Россия';
|
||||
|
||||
//message
|
||||
|
||||
$text['message-update']['en-us'] = "Update Completed";
|
||||
$text['message-update']['es-cl'] = "Actualización Completada";
|
||||
$text['message-update']['pt-pt'] = "Actualização Efectuada";
|
||||
@@ -95,7 +84,7 @@ $text['message-failed']['pt-pt'] = "Falha na atualiza玢o - Contato com o suport
|
||||
$text['message-failed']['fr-fr'] = "Mise ?jour a 閏hou?- Contacter le support technique";
|
||||
$text['message-failed']['pt-br'] = "Falha na atualiza莽茫o - Entre em contato com o suporte";
|
||||
$text['message-failed']['pl'] = "Aktualizacja nie powiod艂a si臋 - skontaktuj si臋 z pomoc膮";
|
||||
$text['message-failed']['uk'] = "袧械 胁写邪谢芯褋褟 芯薪芯胁懈褌懈 - 蟹胁'褟卸褨褌褜褋褟 蟹褨 褋谢褍卸斜芯褞 锌褨写褌褉懈屑泻懈";
|
||||
$text['message-failed']['uk'] = ""
|
||||
$text['message-failed']['sv-se'] = "Uppdatering Misslyckades - Kontakta Support";
|
||||
$text['message-failed']['de-at'] = "Aktualisierung fehlgeschlagen - Kontaktieren Sie den Support";
|
||||
|
||||
|
||||
@@ -30,9 +30,10 @@ class text {
|
||||
*/
|
||||
public function get($language_code = null, $app_path = null, $exclude_global = false) {
|
||||
//get the global app_languages.php
|
||||
if(!$exclude_global){
|
||||
if (!$exclude_global){
|
||||
include $_SERVER["PROJECT_ROOT"]."/resources/app_languages.php";
|
||||
}
|
||||
|
||||
//get the app_languages.php
|
||||
if ($app_path != null) {
|
||||
$lang_path = $_SERVER["PROJECT_ROOT"]."/".$app_path."/app_languages.php";
|
||||
@@ -43,6 +44,7 @@ class text {
|
||||
if(file_exists($lang_path)){
|
||||
require $lang_path;
|
||||
}
|
||||
|
||||
//get the available languages
|
||||
krsort($text);
|
||||
foreach ($text as $lang_label => $lang_codes) {
|
||||
@@ -53,37 +55,29 @@ class text {
|
||||
}
|
||||
}
|
||||
$_SESSION['app']['languages'] = array_unique($app_languages);
|
||||
|
||||
//check the session language
|
||||
if(isset($_SESSION['domain']) and $language_code == null){
|
||||
if (isset($_SESSION['domain']) and $language_code == null){
|
||||
$language_code = $_SESSION['domain']['language']['code'];
|
||||
}elseif($language_code == null){
|
||||
} elseif ($language_code == null){
|
||||
$language_code = 'en-us';
|
||||
}
|
||||
|
||||
//reduce to specific language
|
||||
if ($language_code != 'all') {
|
||||
foreach($text as $key => $value) {
|
||||
if(strlen($value[$language_code]) > 0) {
|
||||
foreach ($text as $key => $value) {
|
||||
if (strlen($value[$language_code]) > 0) {
|
||||
$text[$key] = $value[$language_code];
|
||||
}else{
|
||||
} else {
|
||||
//fallback to en-us
|
||||
$text[$key] = $value['en-us'];
|
||||
}
|
||||
}
|
||||
}
|
||||
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