如何获取翻译的学说实体列名称?

How do I get the doctrine entity column name for translations?

示例:mysql_table

示例树枝文件

您需要使用 twig 的 attribute 功能:

{{ attribute(gender, 'gender' ~ app.request.locale|capitalize) }}

但是,更好的解决方案是使用专门的工具,例如JMSTranslationBundle