[#2849] Fix WebUI error without translation MO file
This commit is contained in:
parent
6de2813c3d
commit
e379e035c7
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue