如何在formtype中翻译symfony dropbox选项

In the form generated by Symfony I would like to translate the child options, how can this be done?

        ->add('business', 'choice', array(
            'choices' => array('Zakelijk' => true, 'Prive' => false),
            'expanded' => true,
            'multiple' => false,
            'choices_as_values' => true,
        ))

I tried to include the standard symfony translation code directly in the code above, but then i get a php error.

$this->get('translator')->trans('business');

words.en.yml

Zakelijk: Zakelijk
Prive: Prive

In your form:

'translation_domain' => 'fooo'

'choices' => array('Zakelijk' => true, 'Prive' => false),

You need to use translations. In your bundle you need to create in Resources/Translations with format i18N and one extension (yml or php or xliff). In your form use for example "app.form.zalelijk" with yaml format.

        'choices' => array('app.form.zakelijk' => true, 'app.form.prive' => false)

Twig will translate the string in your request locale to render the form.