fix: skip if file is not found

This commit is contained in:
Ankush Menat 2024-01-10 20:47:58 +05:30
parent a77093d6f6
commit 1f83fd8847

View file

@ -284,6 +284,8 @@ def get_translations_from_mo(lang, app):
locale_dir = get_locale_dir()
mo_file = gettext.find(app, locale_dir, (lang,))
if not mo_file:
return translations
with open(mo_file, "rb") as f:
catalog = read_mo(f)
for m in catalog: