mirror of https://github.com/CIRCL/AIL-framework
fix: [translate] fix exception
parent
1c52c187ad
commit
5b808ed416
|
@ -269,8 +269,8 @@ class LanguageTranslator:
|
||||||
try:
|
try:
|
||||||
for dict_lang in self.lt.languages():
|
for dict_lang in self.lt.languages():
|
||||||
languages.append({'iso': dict_lang['code'], 'language': dict_lang['name']})
|
languages.append({'iso': dict_lang['code'], 'language': dict_lang['name']})
|
||||||
except:
|
except Exception as e:
|
||||||
pass
|
print(e)
|
||||||
return languages
|
return languages
|
||||||
|
|
||||||
def detect_cld3(self, content):
|
def detect_cld3(self, content):
|
||||||
|
@ -315,7 +315,8 @@ class LanguageTranslator:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
LIST_LANGUAGES = LanguageTranslator().languages()
|
LIST_LANGUAGES = LanguageTranslator().languages()
|
||||||
except Exception:
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
LIST_LANGUAGES = []
|
LIST_LANGUAGES = []
|
||||||
|
|
||||||
def get_translation_languages():
|
def get_translation_languages():
|
||||||
|
|
Loading…
Reference in New Issue