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

why can't translate the full sentence? #23

Open
mashagua opened this issue Mar 15, 2021 · 2 comments
Open

why can't translate the full sentence? #23

mashagua opened this issue Mar 15, 2021 · 2 comments

Comments

@mashagua
Copy link

i want to translate the sentence
aa1="Do you want beneficial technologies being shaped by your ideas? Whether in the areas of mobility solutions, consumer goods, industrial technology or energy and building technology - with us,"
translator.translate(aa1, dest='zh-cn').text
but the result is only "你想要由你的想法塑造的有益技术吗?", only output the first sentences,is this api has the length limit?

@finia2NA
Copy link

Try using this branch: https://github.com/jonata/py-googletranslation
There's some issues with translating special characters that have been fixed there.
I had some Japanese sentences that were only partially translated with the main branch of this repo and work flawlessly with that branch.

@mashagua
Copy link
Author

mashagua commented Apr 2, 2021

Try using this branch: https://github.com/jonata/py-googletranslation
There's some issues with translating special characters that have been fixed there.
I had some Japanese sentences that were only partially translated with the main branch of this repo and work flawlessly with that branch.

I tried according to your suggestion,but there is an error:
Traceback (most recent call last):
File "C:/Users/MSA2SGH/Desktop/interview_docx_xlsx/jd_related/google_trans.py", line 8, in
from pygoogletranslation import Translator
File "C:\Users\MSA2SGH\AppData\Local\Programs\Python\Python36\lib\site-packages\pygoogletranslation_init_.py", line 6, in
from pygoogletranslation.translate import Translator
File "C:\Users\MSA2SGH\AppData\Local\Programs\Python\Python36\lib\site-packages\pygoogletranslation\translate.py", line 14, in
from pygoogletranslation import utils, urls
File "C:\Users\MSA2SGH\AppData\Local\Programs\Python\Python36\lib\site-packages\pygoogletranslation\utils.py", line 8, in
from googletrans.models import TranslatedPart
ImportError: cannot import name 'TranslatedPart'

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

2 participants