Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

Use choice_translation_domain in BooleanType #348

Merged
merged 1 commit into from
Oct 4, 2016

Conversation

core23
Copy link
Member

@core23 core23 commented Oct 2, 2016

I am targetting this branch, because this is a patch.

Changelog

### Changed
 - Use `choice_translation_domain` in `BooleanType`

Subject

When setting the translation_domain option in an custom form, only the label should get affected. The yes and no labels should stay.

@core23 core23 added the patch label Oct 2, 2016
@core23 core23 force-pushed the remove/flash-manager branch 2 times, most recently from bbd0c33 to f15746d Compare October 3, 2016 08:44
@@ -173,6 +174,10 @@ public function testOptions()
unset($expectedOptions['choices_as_values']);
}

if (!method_exists('Symfony\Component\Form\AbstractType', 'configureOptions')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next major missing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -81,6 +81,8 @@ public function configureOptions(OptionsResolver $resolver)
if (method_exists('Symfony\Component\Form\AbstractType', 'configureOptions')) {
$choices = array_flip($choices);

$defaultOptions['choice_translation_domain'] = 'SonataCoreBundle';

// choice_as_value options is not needed in SF 3.0+
if (method_exists('Symfony\Component\Form\FormTypeInterface', 'setDefaultOptions')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next major missing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@OskarStark OskarStark merged commit 26c05fd into sonata-project:3.x Oct 4, 2016
@OskarStark
Copy link
Member

Thank you @core23 👍

@core23 core23 deleted the remove/flash-manager branch October 4, 2016 08:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants