diff --git a/django/templatetags/i18n.py b/django/templatetags/i18n.py index b4438fdf42..190cb70128 100644 --- a/django/templatetags/i18n.py +++ b/django/templatetags/i18n.py @@ -66,9 +66,12 @@ class BlockTranslateNode(Node): return ''.join(result), vars def render(self, context): - context.push() + tmp_context = {} for var, val in self.extra_context.items(): - context[var] = val.render(context) + tmp_context[var] = val.render(context) + # Update() works like a push(), so corresponding context.pop() is at + # the end of function + context.update(tmp_context) singular, vars = self.render_token_list(self.singular) if self.plural and self.countervar and self.counter: count = self.counter.resolve(context)