开发者

Django trans tag within a default filter

开发者 https://www.devze.com 2023-01-13 07:31 出处:网络
Does anyone know how this could properly be written in Django? {{ m开发者_如何学Pythonu.expiry_date|default:\"{% trans \'Free User\' %}\"}}

Does anyone know how this could properly be written in Django?

{{ m开发者_如何学Pythonu.expiry_date|default:"{% trans 'Free User' %}"}}

Obviously, the above does not work since it contains a tag within a tag's filter.


Templates have an underscore syntax for translation also:

{{ mu.expiry_date|default:_("Free User")}}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号