Ignore:
Timestamp:
Mar 17, 2010, 8:46:45 PM (14 years ago)
Author:
nikrou
Message:

Feature 1451 :

  • improve speed to generate pages when locales is not present on system
  • default domain in now piwigo
  • each plugin can have is own domain ({'...'|@translate:my_plugin})
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gettext/include/template.class.php

    r5126 r5167  
    6767
    6868    $this->smarty->assign_by_ref( 'pwg', new PwgTemplateAdapter() );
    69     $this->smarty->register_modifier( 'translate', array('Template', 'mod_translate') );
     69    $this->smarty->register_modifier( 'translate', array(&$this, 'mod_translate') );
    7070    $this->smarty->register_modifier( 'explode', array('Template', 'mod_explode') );
    7171    $this->smarty->register_modifier( 'get_extent', array(&$this, 'get_extent') );
    7272    $this->smarty->register_block('html_head', array(&$this, 'block_html_head') );
    73     $this->smarty->register_function('known_script', array(&$this, 'func_known_script') );
     73    $this->smarty->register_function( 'known_script', array(&$this, 'func_known_script') );
    7474    $this->smarty->register_prefilter( array('Template', 'prefilter_white_space') );
    7575    if ( $conf['compiled_template_cache_language'] )
     
    9999    include($root.'/'.$theme.'/themeconf.inc.php');
    100100
    101     if (isset($themeconf['parent']))
     101    if (isset($themeconf['parent']) and $themeconf['parent'] != $theme)
    102102    {
    103103      $this->set_theme($root, $themeconf['parent'], $path);
     
    386386   * language
    387387   */
    388   static function mod_translate($text)
    389   {
    390     return l10n($text);
     388  public function mod_translate($text, $domain='piwigo')
     389  {
     390    return l10n($text, $domain);
    391391  }
    392392
     
    561561class PwgTemplateAdapter
    562562{
    563   function l10n($text)
    564   {
    565     return l10n($text);
    566   }
    567 
    568   function l10n_dec($s, $p, $v)
    569   {
    570     return l10n_dec($s, $p, $v);
     563  function l10n($text, $domain='piwigo')
     564  {
     565    return l10n($text, $domain);
     566  }
     567
     568  function l10n_dec($s, $p, $v, $domain='piwigo')
     569  {
     570    return l10n_dec($s, $p, $v, $domain);
    571571  }
    572572
Note: See TracChangeset for help on using the changeset viewer.