diff options
author | friendica <info@friendica.com> | 2012-08-12 20:56:23 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-08-12 20:56:23 -0700 |
commit | 184cf51d2f21782d8fa78d833b1439ed692126ff (patch) | |
tree | cc2d74b87c5ac94fe7aa7c97382b6f982810298b /include/language.php | |
parent | 9899cfb5c75b6855e158d855ca0dba1344ca6262 (diff) | |
download | volse-hubzilla-184cf51d2f21782d8fa78d833b1439ed692126ff.tar.gz volse-hubzilla-184cf51d2f21782d8fa78d833b1439ed692126ff.tar.bz2 volse-hubzilla-184cf51d2f21782d8fa78d833b1439ed692126ff.zip |
reduce duplication - only provide one system language setting
Diffstat (limited to 'include/language.php')
-rw-r--r-- | include/language.php | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/include/language.php b/include/language.php index dc54fbd2e..899375dcf 100644 --- a/include/language.php +++ b/include/language.php @@ -68,11 +68,11 @@ function get_best_language() { function push_lang($language) { - global $lang, $a; + global $a; - $a->langsave = $lang; + $a->langsave = $a->language; - if($language === $lang) + if($language === $a->language) return; if(isset($a->strings) && count($a->strings)) { @@ -80,14 +80,14 @@ function push_lang($language) { } $a->strings = array(); load_translation_table($language); - $a->language = $lang = $language; + $a->language = $language; } function pop_lang() { - global $lang, $a; + global $a; - if($lang === $a->langsave) + if($a->language === $a->langsave) return; if(isset($a->stringsave)) @@ -95,7 +95,7 @@ function pop_lang() { else $a->strings = array(); - $a->language = $lang = $a->langsave; + $a->language = $a->langsave; } @@ -136,12 +136,11 @@ function t($s) { if(! function_exists('tt')){ function tt($singular, $plural, $count){ - global $lang; $a = get_app(); if(x($a->strings,$singular)) { $t = $a->strings[$singular]; - $f = 'string_plural_select_' . str_replace('-','_',$lang); + $f = 'string_plural_select_' . str_replace('-','_',$a->language); if(! function_exists($f)) $f = 'string_plural_select_default'; $k = $f($count); |