我需要呈现翻译的推荐书,并使用包含块作为推荐代码,如下所示:
{% include "includes/blog/testimonial.html" with text="This is the best product I've ever used!" name="Tim Z" description="Store Manager" %}
如何将blocktrans
与include
标记一起用于呈现已翻译的包含标记?
谢谢!
答案 0 :(得分:7)
如果我理解正确,您希望将您提供的文字翻译成“包含”标签。如果这是正确的,只需事先将其翻译并将结果保存到变量:
{% trans "This is the best product I've ever used!" as text %}
{% trans "Store Manager" as description %}
{% include "includes/blog/testimonial.html" with text=text name="Tim Z" description=description %}