Add the app session languages array as a list of available languages that have been translated for that application.

This commit is contained in:
Mark Crane
2015-01-18 07:52:28 +00:00
parent c757e68cd1
commit b29c9ce2a2
2 changed files with 15 additions and 5 deletions

View File

@@ -48,5 +48,4 @@ if (!class_exists('database')) {
}
}
?>
?>

View File

@@ -11,9 +11,7 @@ class text {
* Called when the object is created
*/
public function __construct() {
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/translate")) {
include("app/translate/translate_include.php");
}
//place holder
}
/**
@@ -40,6 +38,17 @@ class text {
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
if ($language_code != 'all') {
foreach($text as $key => $value) {
@@ -54,7 +63,9 @@ class text {
//return the array of translations
return $text;
}
}
?>