【发布时间】:2014-02-12 22:14:07
【问题描述】:
这是我的模板代码:
{{ can_edit|yesno:'Allow edit,View Only' }}
但我想从我的翻译字符串中自动翻译它,所以我这样做了:
{{ can_edit|yesno:'{% trans "option_allow_edit" %},{% trans "option_allow_edit" %}' }}
但它不起作用,因为它转义了{% trans %}标签。
我该怎么做?
【问题讨论】:
标签: django templates tags translation