diff options
author | redmatrix <git@macgirvin.com> | 2016-03-31 16:06:03 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-03-31 16:06:03 -0700 |
commit | 9abd95fad3784a10fc48bc40f9b8a75d7d74edda (patch) | |
tree | 3cf2eec6a29f384b80a8c607aa97172b84e37e62 /include/language.php | |
parent | 256c228efd249f2ce93405db8e36f52030aa4876 (diff) | |
download | volse-hubzilla-9abd95fad3784a10fc48bc40f9b8a75d7d74edda.tar.gz volse-hubzilla-9abd95fad3784a10fc48bc40f9b8a75d7d74edda.tar.bz2 volse-hubzilla-9abd95fad3784a10fc48bc40f9b8a75d7d74edda.zip |
static App
Diffstat (limited to 'include/language.php')
-rw-r--r-- | include/language.php | 36 |
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'; |