Author: david
Date: Thu Nov 11 15:05:54 2010
New Revision: 8823

Log:
Create separate messages.xml file for each plugin.

Modified:
   trunk/vendor/symfony/lib/i18n/extract/sfI18nApplicationExtract.class.php
   trunk/vendor/symfony/lib/task/i18n/sfI18nExtractTask.class.php

Modified: 
trunk/vendor/symfony/lib/i18n/extract/sfI18nApplicationExtract.class.php
==============================================================================
--- trunk/vendor/symfony/lib/i18n/extract/sfI18nApplicationExtract.class.php    
Thu Nov 11 14:40:43 2010        (r8822)
+++ trunk/vendor/symfony/lib/i18n/extract/sfI18nApplicationExtract.class.php    
Thu Nov 11 15:05:54 2010        (r8823)
@@ -31,16 +31,6 @@
     {
       $this->extractObjects[] = new sfI18nModuleExtract($this->i18n, 
$this->culture, array('module' => $moduleName));
     }
-
-    // Plugins
-    if ($this->parameters['extractPlugins'])
-    {
-      $pluginNames = 
sfFinder::type('dir')->maxdepth(0)->relative()->not_name('.')->in(sfConfig::get('sf_plugins_dir'));
-      foreach ($pluginNames as $pluginName)
-      {
-        $this->extractObjects[] = new sfI18nPluginExtract($this->i18n, 
$this->culture, array('path' => 
sfConfig::get('sf_plugins_dir').'/'.$pluginName));
-      }
-    }
   }
 
   /**

Modified: trunk/vendor/symfony/lib/task/i18n/sfI18nExtractTask.class.php
==============================================================================
--- trunk/vendor/symfony/lib/task/i18n/sfI18nExtractTask.class.php      Thu Nov 
11 14:40:43 2010        (r8822)
+++ trunk/vendor/symfony/lib/task/i18n/sfI18nExtractTask.class.php      Thu Nov 
11 15:05:54 2010        (r8823)
@@ -38,7 +38,7 @@
       // http://trac.symfony-project.org/ticket/8352
       new sfCommandOption('application', null, 
sfCommandOption::PARAMETER_REQUIRED, 'The application name', true),
 
-      new sfCommandOption('ignore-plugins', null, 
sfCommandOption::PARAMETER_NONE, 'Don\'t extract strings in plugin files'),
+      new sfCommandOption('plugins', null, sfCommandOption::PARAMETER_NONE, 
'Extract plugin strings'),
       new sfCommandOption('display-new', null, 
sfCommandOption::PARAMETER_NONE, 'Output all new found strings'),
       new sfCommandOption('display-old', null, 
sfCommandOption::PARAMETER_NONE, 'Output all old strings'),
       new sfCommandOption('auto-save', null, sfCommandOption::PARAMETER_NONE, 
'Save the new strings'),
@@ -94,7 +94,7 @@
     $params = $config['i18n']['param'];
     unset($params['cache']);
 
-    $extract = new sfI18nApplicationExtract(new $class($this->configuration, 
new sfNoCache(), $params), $arguments['culture'], array('extractPlugins' => 
!$options['ignore-plugins']));
+    $extract = new sfI18nApplicationExtract(new $class($this->configuration, 
new sfNoCache(), $params), $arguments['culture']);
 
     $extract->extract();
 
@@ -132,5 +132,31 @@
 
       $extract->deleteOldMessages();
     }
+
+    // Extract plugin strings 
+    if ($options['plugins'])
+    {
+      unset($options['plugins']);
+      $pluginNames = 
sfFinder::type('dir')->maxdepth(0)->relative()->not_name('.')->in(sfConfig::get('sf_plugins_dir'));
+
+      foreach ($pluginNames as $pluginName)
+      {
+        $extractPlugin = new sfI18nExtractPluginTask($this->dispatcher, 
$this->formatter);
+        $extractPlugin->setCommandApplication($this->commandApplication);
+        $extractPlugin->setConfiguration($this->configuration);
+        $ret = $extractPlugin->run(
+          array(
+            'plugin' => $pluginName,
+            'culture' => $arguments['culture']
+          ),
+          $options
+        );
+
+        if ($ret)
+        {
+          return $ret;
+        }
+      }
+    }
   }
 }

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to