django blocktrans and i18n in templates

后端 未结 5 873
情歌与酒
情歌与酒 2020-12-16 16:35

I have an i18n problem in django:

This works fine :

{% trans cat.name %}  

cat.name will be translated

But t

5条回答
  •  星月不相逢
    2020-12-16 17:29

    {% blocktrans with cat.name as cat_slug %}{{ cat_slug|capfirst }}{% endblocktrans %}
    
    ?
    

    EDIT: you were right the doc says the filter as to be placed in the blocktrans

提交回复
热议问题