Generate docs even if some translation files are missing

This commit is contained in:
Manuel Cortez 2023-02-06 22:12:16 -06:00
parent d0e18178c6
commit d0fcf88b31
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790

View File

@ -10,7 +10,6 @@ from importlib import reload
# Languages already translated or translating the documentation.
documentation_languages = ["en", "es", "fr", "de", "it", "gl", "ja", "ru", "ro", "eu", "ca", "da", "sr"]
# Changelog translated languages.
changelog_languages = ["en", "ca", "de", "es", "eu", "fr", "gl", "ja", "ro", "ru", "sr"]
@ -29,8 +28,13 @@ def get_translations(name):
langs = changelog_languages
for l in langs:
if l != "en":
try:
_ = gettext.translation(name, os.path.join(paths.app_path(), "locales"), languages=[l])
translations[l] = _
print(l, name)
except FileNotFoundError:
_ = gettext.NullTranslations()
translations[l] = _
else:
_ = gettext.NullTranslations()
translations[l] = _