1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #26046 -- Fixed a crash with translations and Django-unknown language code

Thanks Jens Lundstrom for the report and Tim Graham for the review.
This commit is contained in:
Claude Paroz
2016-01-06 18:33:29 +01:00
parent 7cc2efc2d6
commit 632a9f21bc
4 changed files with 15 additions and 2 deletions

View File

@@ -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