mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
i18n: changed resolve_variable and resolve_variable_with_filters to allways
accept string constants and to accept i18n string constants with _(), too. That way the i18n tag isn't needed in simple cases. git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@760 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -102,6 +102,20 @@ variables, not more complex expressions.
|
||||
To translate a variable value, you can just do {% i18n _(variable) %}. This
|
||||
can even include filters like {% i18n _(variable|lower} %}.
|
||||
|
||||
There is additional support for i18n string constants for other situations
|
||||
as well. All template tags that do variable resolving (with or without filters)
|
||||
will accept string constants, too. Those string constants can now be i18n
|
||||
strings like this::
|
||||
|
||||
<html>
|
||||
<title>{{ _('This is the title') }}</title>
|
||||
<body>
|
||||
<p>{{ _('Hello World!') }}</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
This is much shorter, but won't allow you to use gettext_noop or ngettext.
|
||||
|
||||
How the Language is Discovered
|
||||
==============================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user