3

我需要呈现一个翻译的推荐,我使用一个包含块的推荐代码,如下所示:

{% include "includes/blog/testimonial.html" with text="This is the best product I've ever used!" name="Tim Z" description="Store Manager" %}

我将如何blocktrans与标签一起使用include来呈现翻译后的包含标签?

谢谢!!

4

1 回答 1

8

如果我理解正确,您想将您提供的文本翻译为“包含”标签。如果这是正确的,只需事先翻译并将结果保存到变量中:

{% 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 %}
于 2013-09-19T19:35:25.050 回答