translation = None
retries = 0
translator = Translator(service_urls=['translate.googleapis.com'], user_agent=get_random_user_agent())
while translation is None and retries = 2:
sleep(5)
retries += 1
continue
if translation is None:
logging.warning(f"Translation >> failed: {e}, have retry {retries} times, will jump to next line.")
return text
else:
logging.info(f"Translation >> success: {translation}")
return translation
2024-06-27 16:17:57 INFO Translation >> success: 乔治亚州
2024-06-27 16:17:58 INFO Translation >> success: 葡萄牙
2024-06-27 16:17:58 INFO Translated countries: ['乔治亚州', '葡萄牙']
Georgia 没有正确的翻译成格鲁吉亚,而是翻译成了乔治亚州,Turkey 翻译成了火鸡
这个有办法设置吗? Google 了一圈资料,没看到解决办法