How to properly i18n a string
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
精彩评论