Fix "KeyError: 'fr'" in desktop strings.py

This commit is contained in:
Max1Truc 2021-10-27 11:47:17 +02:00
parent 357e3efead
commit e9ef087c8f

View File

@ -43,7 +43,11 @@ def load_strings(common, locale_dir):
current_locale = common.settings.get("locale")
strings = {}
for s in translations[default_locale]:
if s in translations[current_locale] and translations[current_locale][s] != "":
if (
current_locale in translations
and s in translations[current_locale]
and translations[current_locale][s] != ""
):
strings[s] = translations[current_locale][s]
else:
strings[s] = translations[default_locale][s]