aboutsummaryrefslogtreecommitdiffstats
path: root/include/language.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/language.php')
-rw-r--r--include/language.php36
1 files changed, 18 insertions, 18 deletions
diff --git a/include/language.php b/include/language.php
index 121816ae6..1a012cb84 100644
--- a/include/language.php
+++ b/include/language.php
@@ -83,38 +83,38 @@ function get_best_language() {
return $arr['preferred'];
$a = get_app();
- return ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
+ return ((isset(App::$config['system']['language'])) ? App::$config['system']['language'] : 'en');
}
function push_lang($language) {
global $a;
- $a->langsave = $a->language;
+ App::$langsave = App::$language;
- if($language === $a->language)
+ if($language === App::$language)
return;
- if(isset($a->strings) && count($a->strings)) {
- $a->stringsave = $a->strings;
+ if(isset(App::$strings) && count(App::$strings)) {
+ App::$stringsave = App::$strings;
}
- $a->strings = array();
+ App::$strings = array();
load_translation_table($language);
- $a->language = $language;
+ App::$language = $language;
}
function pop_lang() {
global $a;
- if($a->language === $a->langsave)
+ if(App::$language === App::$langsave)
return;
- if(isset($a->stringsave))
- $a->strings = $a->stringsave;
+ if(isset(App::$stringsave))
+ App::$strings = App::$stringsave;
else
- $a->strings = array();
+ App::$strings = array();
- $a->language = $a->langsave;
+ App::$language = App::$langsave;
}
/**
@@ -126,7 +126,7 @@ function pop_lang() {
function load_translation_table($lang, $install = false) {
global $a;
- $a->strings = array();
+ App::$strings = array();
if(file_exists("view/$lang/hstrings.php")) {
include("view/$lang/hstrings.php");
@@ -173,8 +173,8 @@ function t($s, $ctx = '') {
global $a;
$cs = $ctx ? '__ctx:' . $ctx . '__ ' . $s : $s;
- if (x($a->strings, $cs)) {
- $t = $a->strings[$cs];
+ if (x(App::$strings, $cs)) {
+ $t = App::$strings[$cs];
return ((is_array($t)) ? translate_projectname($t[0]) : translate_projectname($t));
}
@@ -208,9 +208,9 @@ function tt($singular, $plural, $count, $ctx = ''){
$a = get_app();
$cs = $ctx ? "__ctx:" . $ctx . "__ " . $singular : $singular;
- if (x($a->strings,$cs)) {
- $t = $a->strings[$cs];
- $f = 'string_plural_select_' . str_replace('-', '_', $a->language);
+ if (x(App::$strings,$cs)) {
+ $t = App::$strings[$cs];
+ $f = 'string_plural_select_' . str_replace('-', '_', App::$language);
if (! function_exists($f))
$f = 'string_plural_select_default';