From 7107b6ff0f2f5d23b73063414046bf4b3de7bbbb Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Mon, 7 Nov 2016 09:59:13 +0100 Subject: [PATCH] Fixed #27454 -- Skipped gettext calls for apps without a locale dir. --- django/utils/translation/trans_real.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py index 84a42490eb..9d246324f0 100644 --- a/django/utils/translation/trans_real.py +++ b/django/utils/translation/trans_real.py @@ -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."""