From e379e035c7326c52101a9ccb105436c5b5211a4a Mon Sep 17 00:00:00 2001 From: bendikro Date: Mon, 31 Oct 2016 22:44:06 +0100 Subject: [PATCH] [#2849] Fix WebUI error without translation MO file --- deluge/ui/util/lang.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deluge/ui/util/lang.py b/deluge/ui/util/lang.py index 36558bfeb..307293c96 100644 --- a/deluge/ui/util/lang.py +++ b/deluge/ui/util/lang.py @@ -37,13 +37,17 @@ def get_translations_path(): def get_languages(): from deluge.ui import languages # Import here so that gettext has been setup first + + lang = [] + translations_path = get_translations_path() for root, dirs, files in os.walk(translations_path): # Get the dirs lang_dirs = dirs break + else: + return lang - lang = [] for i, lang_code in enumerate(lang_dirs): name = "%s (Language name missing)" % lang_code if lang_code in languages.LANGUAGES: