Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种方法可以翻译选择类型的内容(下拉)。内容的值将相同,但应翻译选项中的文本。
只需将密钥添加到您的翻译文件中。
例如,如果您的选择是
array( 1 => "my.choice.1", 2 => "my.choice.2" );
只需添加
<trans-unit id=""> <source>my.choice.1</source> <target>Pizza</target> </trans-unit>
Symfony 将自动在服务内的选择类型中传递选项translator。
translator