Browse Source

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 năm trước cách đây
mục cha
commit
cc9291a90c
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  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'];
     }
 
     /**