是否可以同时使用{% blocktrans %}
“ with ”和“ count ”?
该文档仅描述了单独的使用:
{% blocktrans with foo|filter as bar and baz|filter as boo %}
{% blocktrans count var|length as count %}
我需要打印一个变量的值,而翻译取决于另一个变量。我尝试了以下代码:
{% blocktrans count cnt as count with cnt|make_text_from_count as text_count %}
and other {{ text_count }} city
{% plural %}
and other {{ text_count }} cities
{% endblocktrans %}
它显示text_count
变量的值,但不翻译文本。
Python 2.6.6、Django 1.3、django 模板。