tze*_*man 3 django django-templates django-i18n
我需要呈现翻译的推荐书,我使用包含块作为推荐代码,如下所示:
{% include "includes/blog/testimonial.html" with text="This is the best product I've ever used!" name="Tim Z" description="Store Manager" %}
Run Code Online (Sandbox Code Playgroud)
我如何blocktrans与include标签一起使用来呈现翻译的包含标签?
谢谢!!
如果我理解正确,您希望将您提供的文本翻译为"包含"标签.如果这是正确的,只需事先翻译它并将结果保存到变量:
{% 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 %}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
934 次 |
| 最近记录: |