1
0
mirror of https://github.com/django/django.git synced 2025-10-31 01:25:32 +00:00

Fixed #15157 -- Modified evaluation of literals surrounded by _(' and ')' in templates to be evaluated at render time instead of at compile time by using ugettext_lazy. Thanks Jonathan S for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15327 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Ramiro Morales
2011-01-26 15:12:18 +00:00
parent 69a803a8a6
commit 193f14d862
2 changed files with 134 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ from django.utils.itercompat import is_iterable
from django.utils.functional import curry, Promise
from django.utils.text import smart_split, unescape_string_literal, get_text_list
from django.utils.encoding import smart_unicode, force_unicode, smart_str
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from django.utils.safestring import SafeData, EscapeData, mark_safe, mark_for_escaping
from django.utils.formats import localize
from django.utils.html import escape
@@ -655,7 +655,7 @@ class Variable(object):
# We're dealing with a literal, so it's already been "resolved"
value = self.literal
if self.translate:
return _(value)
return ugettext_lazy(value)
return value
def __repr__(self):