Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get pronunciation (pronunciation is None type) #175

Closed
PasaOpasen opened this issue May 24, 2020 · 3 comments
Closed

Cannot get pronunciation (pronunciation is None type) #175

PasaOpasen opened this issue May 24, 2020 · 3 comments

Comments

@PasaOpasen
Copy link

I use this code:

from googletrans import Translator

translator = Translator()
result = translator.translate('Hello', src='en', dest='ru')

print(result.src)
print(result.dest)
print(result.text)
print(result.pronunciation)

and get result:

en
ru
Привет
None

Translate is correct, but there is no pronunciation. I use googletrans 2.4.0 and python 3.7.7

@kmontambault
Copy link

kmontambault commented Jun 5, 2020

I just had the same issue. I fixed this by modifying line 188 of client.py, changing pron = data[0][1][-2] to pron = data[0][1][2]

@PasaOpasen
Copy link
Author

I just had the same issue. I fixed this by modifying line 188 of client.py, changing pron = data[0][1][-2] to pron = data[0][1][2]

Okay, now it works well for some languages (forks for ru, fr, but not for fa). Thank u, I am waiting while this bag will be fixed

@ssut
Copy link
Owner

ssut commented Jun 9, 2020

Fixed this issue by 312f36a. Thanks.

@ssut ssut closed this as completed Jun 9, 2020
@ssut ssut mentioned this issue Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants