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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user