开发者

Django i18n {% blocktrans %} query

I have been reading through the django i18n translation documentation and I can't figure out the best way to translate a string that contains html.

For instance, the html below. How would I retain <strong></strong> in the blocktrans statement?

<p>This email is to acknowledge placement of order number <strong>{{ order.order_number }}</strong> on {{ order.date|date:"D d M Y" }} at {{ order.date|date:"H:i" }}.</p>

Can a string be constructed somehow?

{% blocktrans with '<strong>'+order.order_number+'</strong>' as order_number order.date|date:"H:i" as order_date %}  ???

Any help would be appr开发者_StackOverflow中文版eciated! =)

Thanks, imanc


Unless your date needs specific language-sensitive formatting, you could make both of those vars in the view code and then just pass them to the template, where a with would be doable

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜