From e9ef087c8fcb3839eb77aa090de0a66f38e8e581 Mon Sep 17 00:00:00 2001 From: Max1Truc Date: Wed, 27 Oct 2021 11:47:17 +0200 Subject: [PATCH] Fix "KeyError: 'fr'" in desktop strings.py --- desktop/src/onionshare/strings.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/desktop/src/onionshare/strings.py b/desktop/src/onionshare/strings.py index c4192a33..55f56788 100644 --- a/desktop/src/onionshare/strings.py +++ b/desktop/src/onionshare/strings.py @@ -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]