Development

Changeset 7430

You must first sign up to be able to contribute.

Changeset 7430

Show
Ignore:
Timestamp:
02/09/08 13:48:45 (8 months ago)
Author:
fabien
Message:

changed sfI18nExtract to take a sfI18N as the first argument (removed sfContext dependency)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/autoload/sfCoreAutoload.class.php

    r7370 r7430  
    291291  'sfConfigureDatabaseTask' => 'task/configure', 
    292292  'sfGenerateAppTask' => 'task/generator', 
    293   'sfGenerateControllerTask' => 'task/generator', 
    294293  'sfGenerateModuleTask' => 'task/generator', 
    295294  'sfGenerateProjectTask' => 'task/generator', 
  • branches/1.1/lib/i18n/extract/sfI18nApplicationExtract.class.php

    r4377 r7430  
    3030    foreach ($moduleNames as $moduleName) 
    3131    { 
    32       $moduleExtract = new sfI18nModuleExtract(); 
    33       $moduleExtract->initialize('en', array('module' => $moduleName)); 
    34  
    35       $this->extractObjects[] = $moduleExtract; 
     32      $this->extractObjects[] = new sfI18nModuleExtract($this->i18n, 'en', array('module' => $moduleName)); 
    3633    } 
    3734  } 
  • branches/1.1/lib/i18n/extract/sfI18nExtract.class.php

    r4957 r7430  
    1919  protected 
    2020    $currentMessages = array(), 
    21     $newMessages = array(), 
     21    $newMessages     = array(), 
    2222    $allSeenMessages = array(), 
    23     $culture = null, 
    24     $parameters = array(), 
    25     $i18n = null; 
     23    $culture         = null, 
     24    $parameters      = array(), 
     25    $i18n            = null; 
    2626 
    2727  /** 
     
    3030   * @see initialize() 
    3131   */ 
    32   public function __construct($culture, $parameters = array()) 
    33   { 
    34     $this->initialize($culture, $parameters); 
     32  public function __construct(sfI18N $i18n, $culture, $parameters = array()) 
     33  { 
     34    $this->initialize($i18n, $culture, $parameters); 
    3535  } 
    3636 
     
    3838   * Initializes the current extract object. 
    3939   * 
     40   * @param sfI18N A sfI18N instance 
    4041   * @param string The culture 
    4142   * @param array  An array of parameters 
    4243   */ 
    43   function initialize($culture, $parameters = array()) 
    44   { 
    45     if (!sfConfig::get('sf_i18n')) 
    46     { 
    47       throw new sfConfigurationException('You must enable "i18n" in your settings.yml configuration file.'); 
    48     } 
    49  
     44  function initialize(sfI18N $i18n, $culture, $parameters = array()) 
     45  { 
    5046    $this->allSeenMessages = array(); 
    5147    $this->newMessages = array(); 
     
    5551    $this->parameters = $parameters; 
    5652 
    57     $this->i18n = sfContext::getInstance()->getI18N()
     53    $this->i18n = $i18n
    5854 
    5955    $this->configure(); 
  • branches/1.1/lib/task/i18n/sfI18nExtractTask.class.php

    r7397 r7430  
    8686    $this->logSection('i18n', sprintf('extracting i18n strings for the "%s" application', $arguments['application'])); 
    8787 
    88     $extract = new sfI18nApplicationExtract(); 
    89     $extract->initialize($arguments['culture']); 
     88    $extract = new sfI18nApplicationExtract(sfContext::getInstance()->getI18N(), $arguments['culture']); 
    9089    $extract->extract(); 
    9190