浏览代码

Fix translation preferred choices in TranslatableChoiceType form type.

Andrey Suslin 12 年之前
父节点
当前提交
2f87e98dcf
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Form/Type/TranslatableChoiceType.php

+ 5 - 0
Form/Type/TranslatableChoiceType.php

@@ -53,6 +53,11 @@ class TranslatableChoiceType extends AbstractType
             $choiceView->label = $this->translator->trans($choiceView->label, array(), $options['catalogue']);
             $choiceView->label = $this->translator->trans($choiceView->label, array(), $options['catalogue']);
         }
         }
 
 
+        // translate preferred options
+        foreach ($view->vars['preferred_choices'] as $choiceView) {
+            $choiceView->label = $this->translator->trans($choiceView->label, array(), $options['catalogue']);
+        }
+
         // translate empty value
         // translate empty value
         if (!empty($view->vars['empty_value'])) {
         if (!empty($view->vars['empty_value'])) {
             $view->vars['empty_value'] = $this->translator->trans($view->vars['empty_value'], array(), $options['catalogue']);
             $view->vars['empty_value'] = $this->translator->trans($view->vars['empty_value'], array(), $options['catalogue']);