소스 검색

Merge pull request #519 from lucasfilippi/translatable_choice

Add translation support for empty_value in TranslatableChoiceType
Thomas 13 년 전
부모
커밋
1b6a423fa2
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      Form/Type/TranslatableChoiceType.php

+ 4 - 0
Form/Type/TranslatableChoiceType.php

@@ -71,5 +71,9 @@ class TranslatableChoiceType extends ChoiceType
         }
 
         $view->set('choices', $choices);
+
+        if ('' !== $view->get('empty_value') && null !== $view->get('empty_value')) {
+            $view->set('empty_value', $this->translator->trans($view->get('empty_value'), array(), $catalogue));
+        }
     }
 }