Author: david
Date: Thu Apr 26 15:34:28 2012
New Revision: 11530

Log:
Drop empty directories

Deleted:
   trunk/plugins/qbAclPlugin/data/
Modified:
   trunk/lib/task/i18n/i18nConsolidateTask.class.php

Modified: trunk/lib/task/i18n/i18nConsolidateTask.class.php
==============================================================================
--- trunk/lib/task/i18n/i18nConsolidateTask.class.php   Thu Apr 26 15:22:34 
2012        (r11529)
+++ trunk/lib/task/i18n/i18nConsolidateTask.class.php   Thu Apr 26 15:34:28 
2012        (r11530)
@@ -175,6 +175,9 @@
         ));
       }
     }
+
+    // Extract fixtures
+    $this->extractFromFixtures();
   }
 
   /**
@@ -206,4 +209,48 @@
 
     $this->updateMessages($messages);
   }
+
+  /**
+   * Extracts i18n strings from YML fixtures
+   *
+   * @param string $dir The PHP full path name
+   */
+  protected function extractFromFixtures()
+  {
+    // Search for YAML files
+    $fixturesDirs = 
array_merge(array(sfConfig::get('sf_data_dir').'/fixtures'), 
$this->configuration->getPluginSubPaths('/data/fixtures'));
+    $files = sfFinder::type('file')->name('*.yml')->in($fixturesDirs);
+
+    if (0 == count($files))
+    {
+      $this->logSection('i18n', 'Warning: Couldn\'t find any fixture files.');
+
+      return;
+    }
+
+    // Merge translations to YAML files in data/fixtures
+    $messages = array();
+    foreach ($files as $file)
+    {
+      $yaml = new sfYaml;
+      $fixtures = $yaml->load($file);
+
+      var_dump($fixtures);
+      die();
+
+      $messages = array_merge($messages, $extracted);
+
+      // Track source file for all messages
+      foreach ($extracted as $message)
+      {
+        if (!isset($this->sourceFile[$message]))
+        {
+          // Link to file in googlecode repository
+          $this->sourceFile[$message] = 
str_replace(sfConfig::get('sf_web_dir'), 
'http://code.google.com/p/qubit-toolkit/source/browse/trunk', $file);
+        }
+      }
+    }
+
+    $this->updateMessages($messages);
+  }
 }

-- 
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