diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-03-17 14:55:30 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-03-17 14:55:30 +0000 |
| commit | e461e737d3843735a316e815cd0afe1b88433e88 (patch) | |
| tree | c14fdceea94f9995723a5956f856ad7741d2e966 | |
| parent | b5adaec4c23e3fa8ab52da1c10eb52f775d02209 (diff) | |
Fixed #4539 -- Fixed a subtle context resolving bug in the i18n template tag.
Excellent debugging from permonik@mesias.brnonet.cz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7261 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/templatetags/i18n.py | 7 |
1 files changed, 5 insertions, 2 deletions
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) |
