Skip to content

Commit

Permalink
fix: [translate] fix exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Dec 8, 2023
1 parent 1c52c18 commit 5b808ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/lib/Language.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ def languages(self):
try:
for dict_lang in self.lt.languages():
languages.append({'iso': dict_lang['code'], 'language': dict_lang['name']})
except:
pass
except Exception as e:
print(e)
return languages

def detect_cld3(self, content):
Expand Down Expand Up @@ -315,7 +315,8 @@ def translate(self, content, source=None, target="en"): # TODO source target

try:
LIST_LANGUAGES = LanguageTranslator().languages()
except Exception:
except Exception as e:
print(e)
LIST_LANGUAGES = []

def get_translation_languages():
Expand Down

0 comments on commit 5b808ed

Please sign in to comment.