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

IndexError for some texts #267

Closed
DanilKonon opened this issue Dec 25, 2020 · 5 comments
Closed

IndexError for some texts #267

DanilKonon opened this issue Dec 25, 2020 · 5 comments

Comments

@DanilKonon
Copy link

Using googletrans-4.0.0rc1, I try to translate "40.41.43.44" and any string which has "//", but the error appears: IndexError: list index out of range
The problem is with this line in client.py:
translated_parts = list(map(lambda part: TranslatedPart(part[0], part[1] if len(part) >= 2 else []), parsed[1][0][0][5]))

@DanilKonon DanilKonon changed the title IndexError for some messages IndexError for some texts Dec 25, 2020
@MyLtYkRiTiK
Copy link

I don't understand why, but code don't like dot without space.
So I simply add replace('.', '. ') and everything works fine

@terryyz
Copy link
Collaborator

terryyz commented Mar 10, 2021

Similar issue #278. Both issues result from the inappropriate way to received the data from https://translate.google.com. Since 4.0.0rc1 has a big update, I may recommend to use the stable version at this stage. It's still unclear if 4.0.0rc1 version is quite buggy.

@stale
Copy link

stale bot commented May 9, 2021

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 stale bot added the wontfix label May 9, 2021
@stale stale bot closed this as completed May 17, 2021
@javiermarcon
Copy link

I'm having the same issue with 4.0.0rc1 using entry.msgstr = translator.translate(entry.msgid, dest="es").text

@illusion-of-existence
Copy link

I am also having the same error. Could anyone suggest solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants