Symfony2: Jak przetłumaczyć niestandardowe komunikaty o błędach w typach formularzy?

Muszę przetłumaczyć komunikaty o błędach z mojego typu formularza. Oto mój formularz Wpisz kod:

<code>class ReferFriendType extends AbstractType {

public function buildForm(FormBuilder $builder, array $options)
{
    $defaultSubject = "This is a default referral subject.";
    $defaultMessage = "This is a default referral message.";

    $builder->add('email1', 'email',array(
        'required' => true,
        'label' => 'Email 1* :',
        'attr' => array('class' => 'large_text'),
    ));
    $builder->add('email2', 'email',array(
        'label' => 'Email 2 :',
        'required' => false,
        'attr' => array('class' => 'large_text'),
    ));
    $builder->add('email3', 'email',array(
        'label' => 'Email 3 :',
        'required' => false,
        'attr' => array('class' => 'large_text'),
    ));
    $builder->add('email4', 'email',array(
        'label' => 'Email 4 :',
        'required' => false,
        'attr' => array('class' => 'large_text'),
    ));
    $builder->add('email5', 'email',array(
        'label' => 'Email 5 :',
        'required' => false,
        'attr' => array('class' => 'large_text'),
    ));
    $builder->add('subject', 'text', array(
        'data' => $defaultSubject,
        'required' => true,
        'label' => 'Subject* :',
        'attr' => array('class' => 'large_text'),
    ));
    $builder->add('message', 'textarea', array(
        'data' => $defaultMessage,
        'required' => true,
        'label' => 'Message* :',
        'attr' => array('rows' => '5', 'cols' => '40'),
    ));

}

public function getDefaultOptions(array $options)
{
    $collectionConstraint = new Collection( array(
        'fields' => array(
            'email1' => array(
                new Email(),
                new NotBlank(array(
                    'message' => 'You must enter atleast one email address for a valid submission',
                )),
            ),
            'subject' => new NotBlank(),
            'message' => new NotBlank(),
        ),
        'allowExtraFields' => true,
        'allowMissingFields' => true,
    ));

    return array(
        'validation_constraint' => $collectionConstraint,
        'csrf_protection' => false,
    );
}

public function getName()
{
    return 'referFriend';
}
</code>

}

Chcę przetłumaczyć „Musisz podać co najmniej jeden adres e-mail w celu prawidłowego przesłania” w metodzie getDefaultOptions () na francuski. Dodałem tłumaczenie w messages.fr.yml. Ale to się nie tłumaczy. Jakieś pomysły, jak można to zrobić?

questionAnswers(4)

yourAnswerToTheQuestion