title: Translate custom form type in symfony2
body: <p>I'm trying to create a custom form type in Symfony (2.7), in order to add an help_block (Boostrap 3 style) to some of my forms fields.</p>
  
  <p>I followed this page instructions : <a href="http://symfony.com/doc/current/cookbook/form/create_form_type_extension.html" rel="nofollow">http://symfony.com/doc/current/cookbook/form/create_form_type_extension.html</a></p>
  
  <p>Displaying is OK, help_block works fine, but it is not translatable, (dev bar not showing any missing translation). So there is my question : <strong>How can I make a custom form type translatable, like the label option, and if possible, in the same translation_domain than the form?</strong></p>
  
  <p>Here is the extension code:</p>
  
  <pre><code>&lt;?php
  
  namespace WIC\MasterBundle\Form\Extension;
  
  use Symfony\Component\Form\AbstractTypeExtension;
  use Symfony\Component\Form\FormBuilderInterface;
  use Symfony\Component\Form\FormView;
  use Symfony\Component\Form\FormInterface;
  use Symfony\Component\PropertyAccess\PropertyAccess;
  use Symfony\Component\OptionsResolver\OptionsResolver;
  
  /**
   * Add a BootStrap Help block to any form field
   */
  class HelpTextExtension extends AbstractTypeExtension
  {
  
      /**
       * Returns the name of the type being extended.
       *
       * @return string The name of the type being extended
       */
      public function getExtendedType() {
          return 'form';
      }
  
      /**
       * Add the help_text option
       *
       * @param OptionsResolver $resolver
       */
      public function configureOptions(OptionsResolver $resolver) {
          $resolver-&gt;setDefined(array('help_text'));
          $resolver-&gt;setDefault('help', null);
      }
  
      /**
       * Pass the Help Text to the view
       *
       * @param FormView $view
       * @param FormInterface $form
       * @param array $options
       */
      public function buildView(FormView $view, FormInterface $form, array $options) {
          $view-&gt;vars['help_text'] = $form-&gt;getConfig()-&gt;getAttribute('help_text');
      }
  
      public function buildForm(FormBuilderInterface $builder, array $options) {
          if (array_key_exists('help_text', $options)) {
              $builder-&gt;setAttribute('help_text', $options['help_text']);
          }
      }
  
  }
  </code></pre>
  
  <p>And my template override:</p>
  
  <pre><code>{% extends 'bootstrap_3_horizontal_layout.html.twig' %}
  
  {% block form_row -%}
      {% spaceless %}
          &lt;div class="form-group{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}"&gt;
              {{ form_label(form) }}
              &lt;div class="{{ block('form_group_class') }}"&gt;
                  {{ form_widget(form) }}
                  {{ form_errors(form) }}
                  {% if help_text is not null %}
                      &lt;span class="help-block"&gt;{{ help_text }}&lt;/span&gt;
                  {% endif %}
              &lt;/div&gt;
          &lt;/div&gt;
      {% endspaceless %}
  {%- endblock form_row %}
  </code></pre>
  
  <p>Thanks in advance for any help,</p>
  
  <p>Best regards</p>