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

res_array[0] out of range error #1

Open
GoblinGe opened this issue Aug 3, 2024 · 0 comments
Open

res_array[0] out of range error #1

GoblinGe opened this issue Aug 3, 2024 · 0 comments

Comments

@GoblinGe
Copy link

GoblinGe commented Aug 3, 2024

If the text to be translated includes \r or \n, the error occurs when using google platform. This is because the code in translate_google.py does not match \r or \n.
Add "| re.DOTALL" in line 56 to fix this problem.

target_text = re.findall(r'id="tw-answ-target-text">(.*?)', res_text, flags=re.IGNORECASE | re.DOTALL)

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

1 participant