Skip to content

Commit

Permalink
Fix translation preferred choices in TranslatableChoiceType form type.
Browse files Browse the repository at this point in the history
  • Loading branch information
suslin committed Oct 30, 2012
1 parent eab3965 commit 2f87e98
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Form/Type/TranslatableChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ public function buildView(FormView $view, FormInterface $form, array $options)
$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']);
Expand Down

0 comments on commit 2f87e98

Please sign in to comment.