summaryrefslogtreecommitdiff
path: root/django/template/base.py
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-01-26 15:12:18 +0000
committerRamiro Morales <cramm0@gmail.com>2011-01-26 15:12:18 +0000
commit193f14d862429c27e061f0f000feddfc6e43e1d8 (patch)
tree84de35eb91cc95a5fbe8381cea31668e7bf9c438 /django/template/base.py
parent69a803a8a66104ac9f64dd39fed657dd577c9776 (diff)
downloaddjango-193f14d862429c27e061f0f000feddfc6e43e1d8.tar.gz
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
Diffstat (limited to 'django/template/base.py')
-rw-r--r--django/template/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/template/base.py b/django/template/base.py
index 1440869098..49ef0b85eb 100644
--- a/django/template/base.py
+++ b/django/template/base.py
@@ -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):