summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2016-11-07 09:59:13 +0100
committerTim Graham <timograham@gmail.com>2016-11-07 09:59:13 +0100
commit7107b6ff0f2f5d23b73063414046bf4b3de7bbbb (patch)
treecd314c7a2fb0f1cc2a86d932f0c1652a2a8364fa
parentcb3fb34b86b17349ec428e789585d0da9604804a (diff)
Fixed #27454 -- Skipped gettext calls for apps without a locale dir.
-rw-r--r--django/utils/translation/trans_real.py5
1 files 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."""