Fixed #27454 -- Skipped gettext calls for apps without a locale dir.

This commit is contained in:
Carl Meyer 2016-11-07 09:59:13 +01:00 committed by Tim Graham
parent cb3fb34b86
commit 7107b6ff0f
1 changed files with 3 additions and 2 deletions

View File

@ -173,8 +173,9 @@ class DjangoTranslation(gettext_module.GNUTranslations):
"gettext calls at import time.")
for app_config in app_configs:
localedir = os.path.join(app_config.path, 'locale')
translation = self._new_gnu_trans(localedir)
self.merge(translation)
if os.path.exists(localedir):
translation = self._new_gnu_trans(localedir)
self.merge(translation)
def _add_local_translations(self):
"""Merges translations defined in LOCALE_PATHS."""