问题
I'm using the google trans library to translate some comments from different languages to English. But when testing this library no matter what I try to translate it will say that the language 'src' is English. Even setting the 'src' to a specific language doesn't fix this problem.
Examples of this can be seen below:
Sample Code 1:
from googletrans import Translator
translator = Translator()
print(translator.translate('veritas lux mea'))
Output:
Translated(src=en, dest=en, text=veritas lux mea, pronunciation=veritas lux mea, extra_data="{'translat...")
Sample Code 2:
from googletrans import Translator
translator = Translator()
print(translator.translate('안녕하세요.'))
Output:
Translated(src=en, dest=en, text=안녕하세요., pronunciation=안녕하세요., extra_data="{'translat...")
Sample Code 3:
from googletrans import Translator
translator = Translator()
print(translator.translate('hola',src="es"))
Output:
Translated(src=en, dest=en, text=hola, pronunciation=hola, extra_data="{'translat...")
Thanks in advance for any help :)
来源:https://stackoverflow.com/questions/64867159/python-googletrans-library-not-translating-correctly