From 642f3fca1a1e56bb1ed823538c0e7fb2ae0e1342 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Wed, 14 Oct 2015 19:48:57 +0200 Subject: [PATCH] fix translation bug for likers --- include/conversation.php | 65 ++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 0907b5dce..8e1793d69 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1025,10 +1025,31 @@ function format_like($cnt,$arr,$type,$id) { $o = ''; $expanded = ''; - if($cnt == 1) + if($cnt == 1) { $likers = $arr[0]; - else { + // Phrase if there is only one liker. In other cases it will be uses for the expanded + // list which show all likers + switch($type) { + case 'like' : + $phrase = sprintf( t('%s likes this.'), $likers); + break; + case 'dislike' : + $phrase = sprintf( t('%s doesn\'t like this.'), $likers); + break; + case 'attendyes' : + $phrase = sprintf( t('%s attends.'), $likers); + break; + case 'attendno' : + $phrase = sprintf( t('%s doesn\'t attend.'), $likers); + break; + case 'attendmaybe' : + $phrase = sprintf( t('%s attends maybe.'), $likers); + break; + } + } + + if($cnt > 1) { $total = count($arr); if($total >= MAX_LIKERS) $arr = array_slice($arr, 0, MAX_LIKERS - 1); @@ -1043,55 +1064,33 @@ function format_like($cnt,$arr,$type,$id) { } $likers = $str; - } - - // Phrase if there is only one liker. In other cases it will be uses for the expanded - // list which show all likers - switch($type) { - case 'like' : - $phrase = sprintf( t('%s likes this.'), $likers); - break; - case 'dislike' : - $phrase = sprintf( t('%s doesn\'t like this.'), $likers); - break; - case 'attendyes' : - $phrase = sprintf( t('%s attends.'), $likers); - break; - case 'attendno' : - $phrase = sprintf( t('%s doesn\'t attend.'), $likers); - break; - case 'attendmaybe' : - $phrase = sprintf( t('%s attends maybe.'), $likers); - break; - } - - if($cnt > 1) { + $spanatts = "class=\"fakelink\" onclick=\"openClose('{$type}list-$id');\""; - $expanded .= "\t" . '
'; + switch($type) { case 'like': $phrase = sprintf( t('%2$d people like this'), $spanatts, $cnt); + $explikers = sprintf( t('%s like this.'), $likers); break; case 'dislike': $phrase = sprintf( t('%2$d people don\'t like this'), $spanatts, $cnt); + $explikers = sprintf( t('%s don\'t like this.'), $likers); break; case 'attendyes': $phrase = sprintf( t('%2$d people attend'), $spanatts, $cnt); + $explikers = sprintf( t('%s attend.'), $likers); break; case 'attendno': $phrase = sprintf( t('%2$d people don\'t attend'), $spanatts, $cnt); + $explikers = sprintf( t('%s don\'t attend.'), $likers); break; case 'attendmaybe': $phrase = sprintf( t('%2$d people anttend maybe'), $spanatts, $cnt); - case 'agree': - $phrase = sprintf( t('%2$d people agree'), $spanatts, $cnt); + $explikers = sprintf( t('%s anttend maybe.'), $likers); break; - case 'disagree': - $phrase = sprintf( t('%2$d people don\'t agree'), $spanatts, $cnt); - break; - case 'abstain': - $phrase = sprintf( t('%2$d people abstains'), $spanatts, $cnt); } + + $expanded .= "\t" . ' '; } $phrase .= EOL ;