开发者

How to properly i18n a string

开发者 https://www.devze.com 2023-01-11 00:13 出处:网络
This more or less complex phrase to translate 开发者_如何学Pythonin my Django template is: This site is owned by \"<a href=\"url\">The Company Name</a>\" and is maintained by partner orga

This more or less complex phrase to translate 开发者_如何学Pythonin my Django template is:

This site is owned by "<a href="url">The Company Name</a>" and is maintained by partner organizations.

Is it as simple as:

{% trans "This site is owned by "<a href="url">The Company Name</a>" and is maintained by partner organizations." %}

Thank you.


From a translation point of view, as long as the translator translates the entire string just like that, you are OK. By that I mean that they put the href around the company name.

From a technical point of view you might want to check out this page: http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/

trans template tag

The {% trans %} template tag translates either a constant string (enclosed in single or double quotes) or variable content:

<title>{% trans "This is the title." %}</title>
<title>{% trans myvar %}</title>

So it appears

0

精彩评论

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