From 03a2eece52f6b3199aae89b927da337a45f17380 Mon Sep 17 00:00:00 2001 From: plegall Date: Mon, 14 May 2012 22:28:45 +0000 Subject: bug fixed: move $lang['%d rate'] from admin.lang.php to common.inc.php to display "1 rate" on picture.php when relevant adapt picture.tpl to display "1 rate" if only 1 rate, instead of "1 rates". git-svn-id: http://piwigo.org/svn/trunk@14978 68402e56-0260-453c-a942-63ccdbb3a9ee --- themes/default/template/picture.tpl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl index cddabf26e..8795d0bc1 100644 --- a/themes/default/template/picture.tpl +++ b/themes/default/template/picture.tpl @@ -217,7 +217,12 @@ y.callService(
{'Rating score'|@translate}
{if $rate_summary.count} - {$rate_summary.score} ({assign var='rate_text' value='%d rates'|@translate}{$pwg->sprintf($rate_text, $rate_summary.count)}) + {if $rate_summary.count == 1} + {assign var='rate_text' value='%d rate'|@translate} + {else} + {assign var='rate_text' value='%d rates'|@translate} + {/if} + {$rate_summary.score} ({$pwg->sprintf($rate_text, $rate_summary.count)}) {else} {'no rate'|@translate} {/if} @@ -251,7 +256,14 @@ y.callService( e = document.getElementById("ratingScore"); if (e) e.innerHTML = rating.score; e = document.getElementById("ratingCount"); - if (e) e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count); + if (e) {ldelim} + if (rating.count == 1) {ldelim} + e.innerHTML = "({'%d rate'|@translate|@escape:'javascript'})".replace( "%d", rating.count); + {rdelim} + else {ldelim} + e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count); + {rdelim} + {rdelim} {rdelim}{rdelim} ); {/footer_script} {/strip} -- cgit v1.2.3