From bda29f1a839cb3fa9c0fa7424bd69ac0eb3eac01 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 7 May 2021 10:35:32 +0200 Subject: [PATCH] [IMP] util: detect incorrect locale_dirs path In case the config is incorrect (e.g. wrong relative path), it is silently ignored. This makes it easier for debugging. --- sphinx/util/i18n.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sphinx/util/i18n.py b/sphinx/util/i18n.py index 1e469d13527..f7298e2e8b7 100644 --- a/sphinx/util/i18n.py +++ b/sphinx/util/i18n.py @@ -91,8 +91,11 @@ def locale_dirs(self) -> Generator[str, None, None]: for locale_dir in self._locale_dirs: locale_dir = path.join(self.basedir, locale_dir) - if path.exists(path.join(locale_dir, self.language, 'LC_MESSAGES')): + locale_path = path.join(locale_dir, self.language, 'LC_MESSAGES') + if path.exists(locale_path): yield locale_dir + else: + logger.verbose(__('locale_dir %s does not exists'), locale_path) @property def pofiles(self) -> Generator[Tuple[str, str], None, None]: