ssut/py-googletrans

TypeError: translate() takes no keyword arguments

a1exjane opened this issue · 3 comments

Please tell me how to fix this bug:
futuro = GoogleTranslator(source="en", target=ttslang).translate(futuro)
print(futuro)
futuro = futuro.translate(futuro, dest=ttslang) <= CRASHES HERE
print(futuro)
futuro = futuro.pronunciation

Output:
I will call
मै बुलाऊंगा
मै बुलाऊंगा
Traceback (most recent call last):
File "imageolden1.py", line 188, in
futuro = futuro.translate(futuro, dest=ttslang)
TypeError: translate() takes no keyword arguments

Did you read docs?

First of all - class name is Translator, not GoogleTranslator

Here is the sample:

from googletrans import Translator

translator = Translator() # you need to init Translator class

translator.translate('안녕하세요.') # use translator method translate() to translate

You need to path parameters to Translator.translate() method, not to Translator() class

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.