#5886: _() syntax in templates only compatible with double-quotes, and the
documentation is fuzzy
-----------------------------------------------------------------+----------
Reporter: Dmitri Fedortchenko <[EMAIL PROTECTED]> |
Owner: nobody
Status: closed |
Component: Documentation
Version: SVN |
Resolution: invalid
Keywords: i18n internationalization templates documentation |
Stage: Unreviewed
Has_patch: 0 |
Needs_docs: 0
Needs_tests: 0 |
Needs_better_patch: 0
-----------------------------------------------------------------+----------
Comment (by Dmitri Fedortchenko <[EMAIL PROTECTED]>):
I think you misunderstood me, or I am misunderstanding you.
The _() syntax DOES work in Python templates, and it is not a Python
construct either.
The internationalization documentation says this:
{{{
{% some_special_tag _("Page not found") value|yesno:_("yes,no") %}
}}}
However, what the documentation fails to mention is that even {{
_("Translate me") }} works.
It also fails to mention the fact that {{ _('Translate me') }} does not
work due to it's single quotes rather then double quotes.
I feel the documentation should note this inconsistency since I am not
aware of any area of the documentation which specifically states that
double quotes must be used when defining constant strings.
The fact of the matter is that templates now support the _() notation, and
the documentation about this is very limited.
I feel that {{_("")}} is better then {% trans "" %} since _() can be used
with filters and tags, but despite this fact the new notation is not given
much attention in the docs.
--
Ticket URL: <http://code.djangoproject.com/ticket/5886#comment:2>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---