-
Notifications
You must be signed in to change notification settings - Fork 245
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
Py-googletrans doesn't have a proper built-in translation text length limit #49
Comments
Already tried with other languages like French, Portuguese and Spanish which all working except Chinese Simplified giving error. |
Translation failed message only happened when if not translated_text or len(translated_text) != len(text_list): If you don't mind, could you upload a failed subtitles file for me to test it out? It will be faster for me to figure out what is happening. I guess it's another bug. |
I test it out. It seems the py-googletrans doesn't handle the case that a single translation text is too long. Though my program judge the length, it's still too long for the text containing full-wide char. To be specific, at the beginning, I want to reduce as many translation requests as possible. So I combine multiple lines of subtitles text to a single big text per translation. Then I find the text length limit of a single request. According to py-googletrans, it has a limit of 15k. To be conservative and according to my common sense about the translate.google.com's 5000 text length limit, I set the size limit to 4000. But somehow it's still too big for the text containing full-wide char. And seems weirder that after setting it to 2000 for full-wide char, it's still not that enough. So I set it to 1000 and it finally works. Now the program will judge whether a text has a full-wide char. If so, its size will count as four times as its length. It may result in a slower translation procedure. If you want the translation faster, you can manually control the sleep time between two translation requests by input |
Commit f0b0ec3 should fix this issue. Thanks for your feedback. |
Hi, thank you for quick response. All works fine.
…On Fri, Aug 2, 2019, 10:34 BingLingFanSub ***@***.***> wrote:
Commit f0b0ec3
<f0b0ec3>
should fix this issue. Thanks for your feedback.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#49?email_source=notifications&email_token=AHKCRDO3XDQ7ZTBYJCGSCTLQCOMKBA5CNFSM4IIPOMY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3MMZIY#issuecomment-517524643>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHKCRDPYWGE2JCW3AJVERHLQCOMKBANCNFSM4IIPOMYQ>
.
|
The text was updated successfully, but these errors were encountered: