Skip to content

Commit

Permalink
[IMP] util: detect incorrect locale_dirs path
Browse files Browse the repository at this point in the history
In case the config is incorrect (e.g. wrong relative path), it is silently ignored.
This makes it easier for debugging.
  • Loading branch information
mart-e committed May 8, 2021
1 parent 5127435 commit bda29f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sphinx/util/i18n.py
Expand Up @@ -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]:
Expand Down

0 comments on commit bda29f1

Please sign in to comment.