diff options
author | Alexandre Hannud Abdo <abdo@member.fsf.org> | 2014-05-21 05:32:46 -0300 |
---|---|---|
committer | Alexandre Hannud Abdo <abdo@member.fsf.org> | 2014-05-21 05:39:35 -0300 |
commit | d15e3776f3ec5476b1614f0488e8e81e0f0ebb70 (patch) | |
tree | f49739dff5fdb2b64f4d48d6031487c64f9f865b /include/language.php | |
parent | ac8400ac0c0e6163b0a83283f78913a85b3c26e0 (diff) | |
download | volse-hubzilla-d15e3776f3ec5476b1614f0488e8e81e0f0ebb70.tar.gz volse-hubzilla-d15e3776f3ec5476b1614f0488e8e81e0f0ebb70.tar.bz2 volse-hubzilla-d15e3776f3ec5476b1614f0488e8e81e0f0ebb70.zip |
Allow translation context with plural. Use that in Likes/Dislikes.
Diffstat (limited to 'include/language.php')
-rw-r--r-- | include/language.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/language.php b/include/language.php index ba14c33be..780dfadba 100644 --- a/include/language.php +++ b/include/language.php @@ -162,11 +162,12 @@ function t($s,$ctx = '') { } -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'; |