Add the app session languages array as a list of available languages that have been translated for that application.
This commit is contained in:
parent
c757e68cd1
commit
b29c9ce2a2
|
|
@ -48,5 +48,4 @@ if (!class_exists('database')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
?>
|
|
||||||
|
|
@ -11,9 +11,7 @@ class text {
|
||||||
* Called when the object is created
|
* Called when the object is created
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/translate")) {
|
//place holder
|
||||||
include("app/translate/translate_include.php");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -40,6 +38,17 @@ class text {
|
||||||
require_once getcwd().'/app_languages.php';
|
require_once getcwd().'/app_languages.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//get the available languages
|
||||||
|
krsort($text);
|
||||||
|
foreach ($text as $lang_label => $lang_codes) {
|
||||||
|
foreach ($lang_codes as $lang_code => $lang_text) {
|
||||||
|
if ($lang_text != '') {
|
||||||
|
$app_languages[] = $lang_code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$_SESSION['app']['languages'] = array_unique($app_languages);
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
if ($language_code != 'all') {
|
if ($language_code != 'all') {
|
||||||
foreach($text as $key => $value) {
|
foreach($text as $key => $value) {
|
||||||
|
|
@ -54,7 +63,9 @@ class text {
|
||||||
|
|
||||||
//return the array of translations
|
//return the array of translations
|
||||||
return $text;
|
return $text;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue