summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-01-06 18:33:29 +0100
committerClaude Paroz <claude@2xlibre.net>2016-01-06 20:30:56 +0100
commit632a9f21bc1212559ba7b7eb298b1128d9f004de (patch)
tree2765b760540ebd6bfdf866472fa2cee8f0986efa /django/utils
parent7cc2efc2d6916c05a0a5cb0c0e67f5405d8f6a03 (diff)
Fixed #26046 -- Fixed a crash with translations and Django-unknown language code
Thanks Jens Lundstrom for the report and Tim Graham for the review.
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/translation/trans_real.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
index b73f2b4869..5208e7a96f 100644
--- a/django/utils/translation/trans_real.py
+++ b/django/utils/translation/trans_real.py
@@ -117,6 +117,9 @@ class DjangoTranslation(gettext_module.GNUTranslations):
# default lang should have at least one translation file available.
raise IOError("No translation files found for default language %s." % settings.LANGUAGE_CODE)
self._add_fallback()
+ if self._catalog is None:
+ # No catalogs found for this language, set an empty catalog.
+ self._catalog = {}
def __repr__(self):
return "<DjangoTranslation lang:%s>" % self.__language