diff --git a/django/templatetags/i18n.py b/django/templatetags/i18n.py
index 0cb7e6a..e6b3b61 100644
a
|
b
|
class BlockTranslateNode(Node):
|
113 | 113 | result = translation.ugettext(singular) |
114 | 114 | # Escape all isolated '%' before substituting in the context. |
115 | 115 | result = re.sub(u'%(?!\()', u'%%', result) |
116 | | data = dict([(v, _render_value_in_context(context[v], context)) for v in vars]) |
| 116 | data = dict([(v, _render_value_in_context(context.get(v, ''), context)) for v in vars]) |
117 | 117 | context.pop() |
118 | 118 | return result % data |
119 | 119 | |
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 54c97ce..fb47b27 100644
a
|
b
|
class Templates(unittest.TestCase):
|
1245 | 1245 | 'i18n32': ('{% load i18n %}{{ "hu"|language_name }} {{ "hu"|language_name_local }} {{ "hu"|language_bidi }}', {}, u'Hungarian Magyar False'), |
1246 | 1246 | 'i18n33': ('{% load i18n %}{{ langcode|language_name }} {{ langcode|language_name_local }} {{ langcode|language_bidi }}', {'langcode': 'nl'}, u'Dutch Nederlands False'), |
1247 | 1247 | |
| 1248 | # blocktrans handling of variables which are not in the context. |
| 1249 | 'i18n34': ('{% load i18n %}{% blocktrans %}{{ missing }}{% endblocktrans %}', {}, u''), |
| 1250 | |
1248 | 1251 | ### HANDLING OF TEMPLATE_STRING_IF_INVALID ################################### |
1249 | 1252 | |
1250 | 1253 | 'invalidstr01': ('{{ var|default:"Foo" }}', {}, ('Foo','INVALID')), |