Changeset 23476
- Timestamp:
- Jun 23, 2013, 8:39:31 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/themes/default/template/tags.tpl
r23426 r23476 151 151 <ul class="tagSelection"> 152 152 {foreach from=$all_tags item=tag} 153 <li>{capture name='showInfo'}<b>{$tag.name}</b> ({$ pwg->l10n_dec('%d photo', '%d photos', $tag.counter)}) <br> <a href="{$tag.U_VIEW}">{'View in gallery'|@translate}</a> | <a href="{$tag.U_EDIT}">{'Manage photos'|@translate}</a>{if !empty($tag.alt_names)}<br>{$tag.alt_names}{/if}{/capture}153 <li>{capture name='showInfo'}<b>{$tag.name}</b> ({$tag.counter|@translate_dec:'%d photo':'%d photos'}) <br> <a href="{$tag.U_VIEW}">{'View in gallery'|@translate}</a> | <a href="{$tag.U_EDIT}">{'Manage photos'|@translate}</a>{if !empty($tag.alt_names)}<br>{$tag.alt_names}{/if}{/capture} 154 154 <a class="icon-info-circled-1 showInfo" title="{$smarty.capture.showInfo|@htmlspecialchars}"></a> 155 155 <label> -
trunk/include/template.class.php
r23425 r23476 56 56 global $conf, $lang_info; 57 57 58 SmartyException::$escape = false; 59 58 60 $this->scriptLoader = new ScriptLoader; 59 61 $this->smarty = new SmartyBC; … … 92 94 $this->smarty->assign( 'pwg', new PwgTemplateAdapter() ); 93 95 $this->smarty->registerPlugin('modifiercompiler', 'translate', array('Template', 'modcompiler_translate') ); 96 $this->smarty->registerPlugin('modifiercompiler', 'translate_dec', array('Template', 'modcompiler_translate_dec') ); 94 97 $this->smarty->registerPlugin('modifier', 'explode', array('Template', 'mod_explode') ); 95 98 $this->smarty->registerPlugin( 'modifier', 'get_extent', array($this, 'get_extent') ); … … 332 335 function clear_assign($tpl_var) 333 336 { 334 $this->smarty->clear _assign( $tpl_var );337 $this->smarty->clearAssign( $tpl_var ); 335 338 } 336 339 … … 362 365 if ( $conf['compiled_template_cache_language'] and isset($lang_info['code']) ) 363 366 { 364 $this->smarty->compile_id .= ' .'.$lang_info['code'];367 $this->smarty->compile_id .= '_'.$lang_info['code']; 365 368 } 366 369 … … 512 515 } 513 516 return 'l10n('.$params[0].')'; 517 } 518 519 static function modcompiler_translate_dec($params) 520 { 521 global $conf, $lang, $lang_info; 522 if ( $conf['compiled_template_cache_language']) 523 { 524 $ret = 'sprintf('; 525 if ($lang_info['zero_plural']) 526 { 527 $ret .= '($tmp=('.$params[0].'))>1||$tmp==0'; 528 } 529 else 530 { 531 $ret .= '('.$params[0].')>1'; 532 } 533 $ret .= '?'; 534 $ret .= self::modcompiler_translate( array($params[2]) ); 535 $ret .= ':'; 536 $ret .= self::modcompiler_translate( array($params[1]) ); 537 $ret .= ','.$params[0]; 538 $ret .= ')'; 539 return $ret; 540 } 541 return 'l10n_dec('.$params[1].','.$params[2].','.$params[0].')'; 514 542 } 515 543 … … 770 798 list($type, $callback) = $filter; 771 799 $compile_id .= $type.( is_array($callback) ? implode('', $callback) : $callback ); 772 call_user_func(array($this->smarty, 'register_'.$type), $callback);800 $this->smarty->registerFilter($type, $callback); 773 801 } 774 802 } … … 786 814 { 787 815 list($type, $callback) = $filter; 788 call_user_func(array($this->smarty, 'unregister_'.$type), $callback);816 $this->smarty->unregisterFilter($type, $callback); 789 817 } 790 818 } -
trunk/themes/default/template/menubar_categories.tpl
r23384 r23476 29 29 {'</li></ul>'|@str_repeat:$ref_level} 30 30 31 <p class="totalImages">{$ pwg->l10n_dec('%d photo', '%d photos', $block->data.NB_PICTURE)}</p>31 <p class="totalImages">{$block->data.NB_PICTURE|@translate_dec:'%d photo':'%d photos'}</p> 32 32 </dd> -
trunk/themes/default/template/menubar_tags.tpl
r8774 r23476 6 6 <a class="tagLevel{$tag.level}" href= 7 7 {if isset($tag.U_ADD)} 8 "{$tag.U_ADD}" title="{$ pwg->l10n_dec('%d photo is also linked to current tags', '%d photos are also linked to current tags', $tag.counter)}" rel="nofollow">+8 "{$tag.U_ADD}" title="{$tag.counter|@translate_dec:'%d photo is also linked to current tags':'%d photos are also linked to current tags'}" rel="nofollow">+ 9 9 {else} 10 10 "{$tag.URL}" title="{'display photos linked to this tag'|@translate}"> -
trunk/themes/default/template/month_calendar.tpl
r14028 r23476 13 13 {else} 14 14 {foreach from=$bar.items item=item} 15 <span class="calItem{if !isset($item.URL)}Empty{/if}" {if isset($item.NB_IMAGES)}title="{$ pwg->l10n_dec('%d photo', '%d photos', $item.NB_IMAGES)}"{/if}>15 <span class="calItem{if !isset($item.URL)}Empty{/if}" {if isset($item.NB_IMAGES)}title="{$item.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if}> 16 16 {if isset($item.URL)} 17 17 <a href="{$item.URL}">{$item.LABEL}</a> … … 69 69 <div class="calImg"> 70 70 <a href="{$day.U_IMG_LINK}"> 71 <img style="{$day.IMAGE_STYLE}" src="{$day.IMAGE}" alt="{$day.IMAGE_ALT}" title="{$ pwg->l10n_dec('%d photo','%d photos', $day.NB_ELEMENTS)}">71 <img style="{$day.IMAGE_STYLE}" src="{$day.IMAGE}" alt="{$day.IMAGE_ALT}" title="{$day.NB_ELEMENTS|@translate_dec:'%d photo':'%d photos'}"> 72 72 </a> 73 73 </div> -
trunk/themes/default/template/picture.tpl
r23437 r23476 213 213 <dd> 214 214 {if $rate_summary.count} 215 {if $rate_summary.count == 1} 216 {assign var='rate_text' value='%d rate'|@translate} 217 {else} 218 {assign var='rate_text' value='%d rates'|@translate} 219 {/if} 220 <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$pwg->sprintf($rate_text, $rate_summary.count)})</span> 215 <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:'%d rate':'%d rates'})</span> 221 216 {else} 222 217 <span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span> … … 336 331 {if isset($COMMENT_COUNT)} 337 332 <div id="comments" {if (!isset($comment_add) && ($COMMENT_COUNT == 0))}class="noCommentContent"{else}class="commentContent"{/if}><div id="commentsSwitcher"></div> 338 <h3>{$ pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>333 <h3>{$COMMENT_COUNT|@translate_dec:'%d comment':'%d comments'}</h3> 339 334 340 335 <div id="pictureComments"> -
trunk/themes/default/template/tags.tpl
r18455 r23476 24 24 <div id="fullTagCloud"> 25 25 {foreach from=$tags item=tag} 26 <span><a href="{$tag.URL}" class="tagLevel{$tag.level}" title="{$ pwg->l10n_dec('%d photo', '%d photos', $tag.counter)}">{$tag.name}</a></span>26 <span><a href="{$tag.URL}" class="tagLevel{$tag.level}" title="{$tag.counter|@translate_dec:'%d photo':'%d photos'}">{$tag.name}</a></span> 27 27 {/foreach} 28 28 </div> … … 40 40 <tr class="tagLine"> 41 41 <td><a href="{$tag.URL}" title="{$tag.name}">{$tag.name}</a></td> 42 <td class="nbEntries">{$ pwg->l10n_dec('%d photo', '%d photos', $tag.counter)}</td>42 <td class="nbEntries">{$tag.counter|@translate_dec:'%d photo':'%d photos'}</td> 43 43 </tr> 44 44 {/foreach}
Note: See TracChangeset
for help on using the changeset viewer.