Translate select options in Symfony2 class forms

前端 未结 4 1600
孤城傲影
孤城傲影 2020-12-08 10:00

I\'m using a class form in Symfony2 Beta3 as follows:

namespace Partners\\FrontendBundle\\Form;

use Symfony\\Component\\Form\\AbstractType;
use Symfony\\Com         


        
4条回答
  •  暖寄归人
    2020-12-08 10:52

    In symfony 2.7, using the choice_label argument, you can specify the translation domain like this:

    'choice_label' => 'typeName',
    'choice_translation_domain' => 'messages',
    

    Without specifying the domain, options are not translated.

提交回复
热议问题