|
@@ -7,7 +7,10 @@ from datetime import datetime, timezone, timedelta
|
|
|
|
|
|
def translate(text):
|
|
|
#result = Translator().translate(text, dest='en')
|
|
|
- result = GoogleTranslator(source='zh-tw', target='en').translate(text)
|
|
|
+ try:
|
|
|
+ result = GoogleTranslator(source='zh-tw', target='en').translate(text)
|
|
|
+ except:
|
|
|
+ result = text
|
|
|
#translator= Translator(from_lang="zh-tw",to_lang="en")
|
|
|
#result = translator.translate(text)
|
|
|
return str(result).lower()
|