Fix crash if translations are missing

This commit is contained in:
bendikro 2014-01-25 15:58:04 +01:00
parent 188315735b
commit ff8b5aca75

View File

@ -912,8 +912,11 @@ def set_language(lang):
set_env_variable('LANG', lang) # For OSX set_env_variable('LANG', lang) # For OSX
translations_path = get_translations_path() translations_path = get_translations_path()
ro = gettext.translation("deluge", localedir=translations_path, languages=[lang]) try:
ro.install() ro = gettext.translation("deluge", localedir=translations_path, languages=[lang])
ro.install()
except IOError, e:
log.warn("IOError when loading translations: %s", e)
# Initialize gettext # Initialize gettext