瀏覽代碼

Expanded choices are now translated

Expanded choices are added to the form by the $options[choice_list] which was never translated. The translation_domain option of the view was never set, so is always getting the default (messages) value.
I update the translation_domain with the $options['catalogue'] to resolve this problems.
crisei 12 年之前
父節點
當前提交
cc9291a90c
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Form/Type/TranslatableChoiceType.php

+ 1 - 0
Form/Type/TranslatableChoiceType.php

@@ -62,6 +62,7 @@ class TranslatableChoiceType extends AbstractType
         if (!empty($view->vars['empty_value'])) {
             $view->vars['empty_value'] = $this->translator->trans($view->vars['empty_value'], array(), $options['catalogue']);
         }
+        $view->vars['translation_domain'] = $options['catalogue'];
     }
 
     /**