aboutsummaryrefslogtreecommitdiffstats
path: root/include/language.php
diff options
context:
space:
mode:
authorAlexandre Hannud Abdo <abdo@member.fsf.org>2014-05-21 05:32:46 -0300
committerAlexandre Hannud Abdo <abdo@member.fsf.org>2014-05-21 05:39:35 -0300
commitd15e3776f3ec5476b1614f0488e8e81e0f0ebb70 (patch)
treef49739dff5fdb2b64f4d48d6031487c64f9f865b /include/language.php
parentac8400ac0c0e6163b0a83283f78913a85b3c26e0 (diff)
downloadvolse-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.php7
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';