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
This commit is contained in:
plegall 2012-05-14 22:28:45 +00:00
commit 03a2eece52
19 changed files with 23 additions and 11 deletions

View file

@ -217,7 +217,12 @@ y.callService(
<dt>{'Rating score'|@translate}</dt>
<dd>
{if $rate_summary.count}
<span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({assign var='rate_text' value='%d rates'|@translate}{$pwg->sprintf($rate_text, $rate_summary.count)})</span>
{if $rate_summary.count == 1}
{assign var='rate_text' value='%d rate'|@translate}
{else}
{assign var='rate_text' value='%d rates'|@translate}
{/if}
<span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$pwg->sprintf($rate_text, $rate_summary.count)})</span>
{else}
<span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span>
{/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}