Django i18n模板包含标签
发布时间:2020-12-20 11:30:03 所属栏目:Python 来源:网络整理
导读:我需要呈现翻译的推荐书,我使用包含块作为推荐代码,如下所示: {% include "includes/blog/testimonial.html" with text="This is the best product I've ever used!" name="Tim Z" description="Store Manager" %} 我如何将blocktrans与include标签一起使用
我需要呈现翻译的推荐书,我使用包含块作为推荐代码,如下所示:
{% include "includes/blog/testimonial.html" with text="This is the best product I've ever used!" name="Tim Z" description="Store Manager" %} 我如何将blocktrans与include标签一起使用来呈现翻译的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 %} (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- python – 批处理:GNU-make,Snakemake还是什么?
- python – Yum没有在CentOS 7上安装某些软件包
- django找不到新的sqlite版本? (需要SQLite 3.8.
- 基于python中staticmethod和classmethod的区别(详
- python 3个文件合并成3列.py
- pi计算中的分段错误(python)
- python安装PIL模块时Unable to find vcvarsall.b
- flask开发中遇到jinja2.exceptions.UndefinedErr
- 实例解析Python的Twisted框架中Deferred对象的用
- Python之Web框架Django项目搭建全过程
热点阅读