[#2849] Fix WebUI error without translation MO file

This commit is contained in:
bendikro 2016-10-31 22:44:06 +01:00 committed by Calum Lind
parent 6de2813c3d
commit e379e035c7
1 changed files with 5 additions and 1 deletions

View File

@ -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: