summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-09-08 13:24:41 +0000
committerJannis Leidel <jannis@leidel.info>2011-09-08 13:24:41 +0000
commit16bb9c594cf7306f4b2fc3ba915be43b05dad5d2 (patch)
tree447587001df5ccf70e094b6e89d796c80c54ae7a /django/utils
parent2b4341d532b376702a17212a9ff9f8710ca4c14a (diff)
Fixed #16516 -- Relaxed the blocktrans rendering a little by falling back to the default language if resolving one of the arguments fails, raising a KeyError. Thanks, Claude Paroz and Aymeric Augustin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/translation/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/utils/translation/__init__.py b/django/utils/translation/__init__.py
index acf4d8dead..8ad9c5d59a 100644
--- a/django/utils/translation/__init__.py
+++ b/django/utils/translation/__init__.py
@@ -115,7 +115,10 @@ class override(object):
self.old_language = get_language()
def __enter__(self):
- activate(self.language)
+ if self.language is not None:
+ activate(self.language)
+ else:
+ deactivate_all()
def __exit__(self, exc_type, exc_value, traceback):
if self.deactivate: