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

Translation fails on random pages on dev #686

Open
Alexamenus opened this issue Dec 17, 2024 · 3 comments
Open

Translation fails on random pages on dev #686

Alexamenus opened this issue Dec 17, 2024 · 3 comments

Comments

@Alexamenus
Copy link

Alexamenus commented Dec 17, 2024

[ERROR ] init:create_error_dialog:29 - 52 --> text must be a valid text with maximum 5000 character, otherwise it cannot be translated
Translation Failed.

[ERROR ] init:create_error_dialog:30 - Traceback (most recent call last):
File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\ui\module_manager.py", line 203, in _translate_page
self.translator.translate_textblk_lst(page)
File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\base.py", line 205, in translate_textblk_lst
_translations = self.translate(text_list)
File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\base.py", line 153, in translate
text_trans = self._translate(text_source)
File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\trans_google.py", line 320, in _translate
translations = [self.googletrans.translate(t) for t in src_list]
File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\trans_google.py", line 320, in
translations = [self.googletrans.translate(t) for t in src_list]
File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\trans_google.py", line 186, in translate
if self._validate_payload(text):
File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\trans_google.py", line 60, in _validate_payload
raise NotValidPayload(payload)
modules.translators.exceptions.NotValidPayload: 52 --> text must be a valid text with maximum 5000 character, otherwise it cannot be translated

@Alexamenus Alexamenus changed the title Translation fails on random pages. Translation fails on random pages on dev Dec 18, 2024
@bropines
Copy link
Contributor

[ERROR ] init:create_error_dialog:29 - 52 --> text must be a valid text with maximum 5000 character, otherwise it cannot be translated Translation Failed.

[ERROR ] init:create_error_dialog:30 - Traceback (most recent call last): File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\ui\module_manager.py", line 203, in _translate_page self.translator.translate_textblk_lst(page) File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\base.py", line 205, in translate_textblk_lst _translations = self.translate(text_list) File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\base.py", line 153, in translate text_trans = self._translate(text_source) File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\trans_google.py", line 320, in _translate translations = [self.googletrans.translate(t) for t in src_list] File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\trans_google.py", line 320, in translations = [self.googletrans.translate(t) for t in src_list] File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\trans_google.py", line 186, in translate if self._validate_payload(text): File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\trans_google.py", line 60, in _validate_payload raise NotValidPayload(payload) modules.translators.exceptions.NotValidPayload: 52 --> text must be a valid text with maximum 5000 character, otherwise it cannot be translated

It literally tells you that there is an error in the translator. Is the error still ongoing? I can see what's wrong

@Alexamenus
Copy link
Author

Alexamenus commented Dec 22, 2024

[ERROR ] init:create_error_dialog:29 - 52 --> text must be a valid text with maximum 5000 character, otherwise it cannot be translated Translation Failed.
[ERROR ] init:create_error_dialog:30 - Traceback (most recent call last): File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\ui\module_manager.py", line 203, in _translate_page self.translator.translate_textblk_lst(page) File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\base.py", line 205, in translate_textblk_lst _translations = self.translate(text_list) File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\base.py", line 153, in translate text_trans = self._translate(text_source) File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\trans_google.py", line 320, in _translate translations = [self.googletrans.translate(t) for t in src_list] File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\trans_google.py", line 320, in translations = [self.googletrans.translate(t) for t in src_list] File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\trans_google.py", line 186, in translate if self._validate_payload(text): File "C:\Users\user\OneDrive\Desktop\BallonsTranslator_dev_src_with_gitpython\modules\translators\trans_google.py", line 60, in _validate_payload raise NotValidPayload(payload) modules.translators.exceptions.NotValidPayload: 52 --> text must be a valid text with maximum 5000 character, otherwise it cannot be translated

It literally tells you that there is an error in the translator. Is the error still ongoing? I can see what's wrong

the error message is not correct, it happens on at least 10 pages per 30 pages translated. on varying amounts of text, it can be between one speech bubble, or (most likely the case) the entire page, all of which being between the threshold of 1 - 5000 characters. This leads me to believe that the actual error is in the text detection not the translator but that is just a guess.
I can also affirm that on pages where the program failed in automatic mode with this error, the program has no problem detecting and translating manually within the UI, so it is most certainly a bug.

@bropines
Copy link
Contributor

Rather, Google even updated it, so everything broke. I'll fix it later.

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