Browse Source

Translation are now removed from the Type

crisei 12 năm trước cách đây
mục cha
commit
68ec8aa22a
1 tập tin đã thay đổi với 1 bổ sung15 xóa
  1. 1 15
      Form/Type/TranslatableChoiceType.php

+ 1 - 15
Form/Type/TranslatableChoiceType.php

@@ -47,21 +47,7 @@ class TranslatableChoiceType extends AbstractType
      * {@inheritDoc}
      */
     public function buildView(FormView $view, FormInterface $form, array $options)
-    {
-        // translate options before building form
-        foreach ($view->vars['choices'] as $choiceView) {
-            $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
-        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'];
     }