diff options
author | RedMatrix <info@friendica.com> | 2014-05-21 19:24:24 +1000 |
---|---|---|
committer | RedMatrix <info@friendica.com> | 2014-05-21 19:24:24 +1000 |
commit | 3e75f9cbb1c74cb140f07b92627101d774724a80 (patch) | |
tree | a80b1d1cd1e46a243e2afe3922c85214a2a9f1de /include/language.php | |
parent | 77ca117218382b57e2d0590466d9fc38dc016e80 (diff) | |
parent | d15e3776f3ec5476b1614f0488e8e81e0f0ebb70 (diff) | |
download | volse-hubzilla-3e75f9cbb1c74cb140f07b92627101d774724a80.tar.gz volse-hubzilla-3e75f9cbb1c74cb140f07b92627101d774724a80.tar.bz2 volse-hubzilla-3e75f9cbb1c74cb140f07b92627101d774724a80.zip |
Merge pull request #464 from solstag/master
Bunch of translation work
Diffstat (limited to 'include/language.php')
-rw-r--r-- | include/language.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/language.php b/include/language.php index f4c7d1524..780dfadba 100644 --- a/include/language.php +++ b/include/language.php @@ -153,19 +153,21 @@ function load_translation_table($lang, $install = false) { function t($s,$ctx = '') { global $a; - if(x($a->strings,$s)) { - $t = $a->strings[$s]; + $cs = $ctx?"__ctx:".$ctx."__ ".$s:$s; + if(x($a->strings,$cs)) { + $t = $a->strings[$cs]; return is_array($t) ? $t[0] : $t; } return $s; } -function tt($singular, $plural, $count){ +function tt($singular, $plural, $count, $ctx = ''){ $a = get_app(); - if(x($a->strings,$singular)) { - $t = $a->strings[$singular]; + $cs = $ctx?"__ctx:".$ctx."__ ".$singular:$singular; + if(x($a->strings,$cs)) { + $t = $a->strings[$cs]; $f = 'string_plural_select_' . str_replace('-', '_', $a->language); if(! function_exists($f)) $f = 'string_plural_select_default'; |