Open mrmelf opened 3 years ago
melvynfeuerman@yahoo.com writes : google trans_new has suddenly stopped working about 10 days ago.. Is there something i am missing...
def translate1(translatethis,langdest):
translator = google_translator() translate_text = translator.translate('สวัสดีจีน',lang_tgt='en') print (' in new translate routine***' ) print ( translate_text) translate_text = translator.translate('muy bien1',lang_tgt='en') print ( translate_text) vr_response = 'muy bien2' target_language = 'en' translate_text = translator.translate(translatethis,lang_tgt=langdest) print ( translate_text) return ()
output: in new translate routine*** 2021-07-09 11:34:45 ERROR 2021-07-09 11:34:45 ERROR 2021-07-09 11:34:45 ERROR
Your code should look something like this:
from google_trans_new import google_translator
def translate1(translatethis,langdest):
translator = google_translator()
translate_text = translator.translate('สวัสดีจีน',lang_tgt='en')
print (' in new translate routine***' )
print ( translate_text)
translate_text = translator.translate('muy bien1',lang_tgt='en')
print ( translate_text)
vr_response = 'muy bien2'
target_language = 'en'
translate_text = translator.translate(translatethis,lang_tgt=langdest)
print ( translate_text)
return ()
translate1('bonjour', 'en')
You must import the relevant package, use indentation and call to the function with the correct arguments. The return statement is also vacuous (though not wrong), since the function doesn't return any value.
google trans_new has suddenly stopped working about 10 days ago.. Driving me crazy!!!
def translate1(translatethis,langdest):
output: in new translate routine*** 2021-07-09 11:34:45 ERROR 2021-07-09 11:34:45 ERROR 2021-07-09 11:34:45 ERROR