Author: gbastien
Date: 2010-04-18 18:57:56 +0200 (Sun, 18 Apr 2010)
New Revision: 29193

Modified:
   plugins/sfI18nFormExtractorPlugin/CHANGELOG
   plugins/sfI18nFormExtractorPlugin/lib/sfI18nFormExtract.class.php
Log:
Now also translating form's choice values

Modified: plugins/sfI18nFormExtractorPlugin/CHANGELOG
===================================================================
--- plugins/sfI18nFormExtractorPlugin/CHANGELOG 2010-04-18 16:42:14 UTC (rev 
29192)
+++ plugins/sfI18nFormExtractorPlugin/CHANGELOG 2010-04-18 16:57:56 UTC (rev 
29193)
@@ -1,3 +1,7 @@
+gbastien -2010-04-18
+
+  - Also translating form's choice values
+
 r29191 - gbastien - 2010-04-18
   
   - Added a new plugin extraction task that saves the internationalized 
strings into the plugin's own catalogue

Modified: plugins/sfI18nFormExtractorPlugin/lib/sfI18nFormExtract.class.php
===================================================================
--- plugins/sfI18nFormExtractorPlugin/lib/sfI18nFormExtract.class.php   
2010-04-18 16:42:14 UTC (rev 29192)
+++ plugins/sfI18nFormExtractorPlugin/lib/sfI18nFormExtract.class.php   
2010-04-18 16:57:56 UTC (rev 29193)
@@ -33,6 +33,7 @@
     {
       $this->registerErrorMessages();
       $this->processLabels();
+      $this->processValues();
       $this->updateMessages($this->getFormMessages());
     }
   }
@@ -81,4 +82,15 @@
     }
     $this->processMessages();
   }
+  
+  private function processValues() {
+    $widgetSchema = $this->form->getWidgetSchema()->getFields();
+    foreach ($widgetSchema as $name => $widget) {
+      if ($widget instanceof sfWidgetFormChoiceBase) {
+        foreach ($widget->getChoices() as $key => $value) {
+          $this->messages[] = $value;
+        }
+      }
+    }
+  }
 }
\ No newline at end of file

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" 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/symfony-svn?hl=en.

Reply via email to