Symfony 表单、标签不用翻译
Symfony forms, labels not to be translated
我有一些不需要翻译的表格标签(例如,IBAN、PayPal 电子邮件、Skype...)
我可以避免翻译它们(这会无用地增加翻译文件的大小),而不会出现 "Missing messages" 错误吗?
我正在使用标准的 Doctrine 实体 + FormType class + Twig 布局
在您的 FormType 中,只需将 'translation_domain' 选项设置为 false。
http://symfony.com/doc/current/reference/forms/types/form.html#translation-domain
您也可以在 children 上使用此选项。
我有一些不需要翻译的表格标签(例如,IBAN、PayPal 电子邮件、Skype...)
我可以避免翻译它们(这会无用地增加翻译文件的大小),而不会出现 "Missing messages" 错误吗?
我正在使用标准的 Doctrine 实体 + FormType class + Twig 布局
在您的 FormType 中,只需将 'translation_domain' 选项设置为 false。
http://symfony.com/doc/current/reference/forms/types/form.html#translation-domain
您也可以在 children 上使用此选项。