You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use an entity field type and the choice_label option to render the label of the field "title". The "title" column contains a fully localized string, but when using the {{ form_label }} inside twig, the title will be translated using the messages domain (and marked as missing in the profiler). This can result to unexpected labels.
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('groups', 'entity', array(
'class' => 'MyTestBundle:Group',
'choice_label' => 'title',
));
}
There should be a way to disable the translation of the label completely and show the label as-is, but escaped. Setting "translation_domain" or "choice_translation_domain" to FALSE (as it should be done to disable labels completely) has no impact. The only workaround I have found is to use a non-existing domain, but this is a hack and will also call the translator. I also don't want to override the default label widget.
Disabling the translation of labels could also improve performance because no message catalogues have to be read by the translator.