1
0
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:
Georg Bauer
2005-10-01 16:24:21 +00:00
parent 280747f757
commit ae3c26df62
3 changed files with 66 additions and 4 deletions

View File

@@ -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
==============================