[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.
This commit is contained in:
Martin Trigaux
2021-05-07 10:35:32 +02:00
parent 512743525c
commit bda29f1a83

View File

@@ -91,8 +91,11 @@ class CatalogRepository:
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]: