aboutsummaryrefslogtreecommitdiffstats
path: root/include/language.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-04-03 21:36:29 -0400
committerAndrew Manning <tamanning@zoho.com>2016-04-03 21:36:29 -0400
commit0523b4b2f1012a8b5f3bffb7f136a20dc9a4e43f (patch)
treea92197de4503ec52889dc05483493f4df1a305b8 /include/language.php
parent99d9456b3addc651a68874ddd391d25684252c4d (diff)
parentb4c1baada1fba46d4d75f40a7e78111d70d54e7a (diff)
downloadvolse-hubzilla-0523b4b2f1012a8b5f3bffb7f136a20dc9a4e43f.tar.gz
volse-hubzilla-0523b4b2f1012a8b5f3bffb7f136a20dc9a4e43f.tar.bz2
volse-hubzilla-0523b4b2f1012a8b5f3bffb7f136a20dc9a4e43f.zip
Merge branch 'master' of https://github.com/redmatrix/hubzilla into contextual-help
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';