title: Symfony2: How to translate custom error messages in form types?
body: <p>I need to translate the error messages from my form type. Here is my form Type code:</p>
  
  <pre><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-&gt;add('email1', 'email',array(
          'required' =&gt; true,
          'label' =&gt; 'Email 1* :',
          'attr' =&gt; array('class' =&gt; 'large_text'),
      ));
      $builder-&gt;add('email2', 'email',array(
          'label' =&gt; 'Email 2 :',
          'required' =&gt; false,
          'attr' =&gt; array('class' =&gt; 'large_text'),
      ));
      $builder-&gt;add('email3', 'email',array(
          'label' =&gt; 'Email 3 :',
          'required' =&gt; false,
          'attr' =&gt; array('class' =&gt; 'large_text'),
      ));
      $builder-&gt;add('email4', 'email',array(
          'label' =&gt; 'Email 4 :',
          'required' =&gt; false,
          'attr' =&gt; array('class' =&gt; 'large_text'),
      ));
      $builder-&gt;add('email5', 'email',array(
          'label' =&gt; 'Email 5 :',
          'required' =&gt; false,
          'attr' =&gt; array('class' =&gt; 'large_text'),
      ));
      $builder-&gt;add('subject', 'text', array(
          'data' =&gt; $defaultSubject,
          'required' =&gt; true,
          'label' =&gt; 'Subject* :',
          'attr' =&gt; array('class' =&gt; 'large_text'),
      ));
      $builder-&gt;add('message', 'textarea', array(
          'data' =&gt; $defaultMessage,
          'required' =&gt; true,
          'label' =&gt; 'Message* :',
          'attr' =&gt; array('rows' =&gt; '5', 'cols' =&gt; '40'),
      ));
  
  }
  
  public function getDefaultOptions(array $options)
  {
      $collectionConstraint = new Collection( array(
          'fields' =&gt; array(
              'email1' =&gt; array(
                  new Email(),
                  new NotBlank(array(
                      'message' =&gt; 'You must enter atleast one email address for a valid submission',
                  )),
              ),
              'subject' =&gt; new NotBlank(),
              'message' =&gt; new NotBlank(),
          ),
          'allowExtraFields' =&gt; true,
          'allowMissingFields' =&gt; true,
      ));
  
      return array(
          'validation_constraint' =&gt; $collectionConstraint,
          'csrf_protection' =&gt; false,
      );
  }
  
  public function getName()
  {
      return 'referFriend';
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I want to translate 'You must enter atleast one email address for a valid submission' in getDefaultOptions() method into french. I have added the translation in the messages.fr.yml. But it is not getting translated. Any ideas how this can be done?</p>