The latest update to the DeepL interface added a skeleton display for text that is still being translated. This creates a problem, because deepl-cli does not wait for the entire text to be translated, but copies it as soon as the length of the translated text is > 0 and thus the result contains an incomplete translation and ‘[...]’
I solved this problem in the following way:
res = str((await output_textbox.all_inner_texts())[0])
attempts=3
while "[...]" in res:
time.sleep(20)
res = str((await output_textbox.all_inner_texts())[0])
attempts -= 1
if attempts == 0:
print("give up\n")
break
Ideally, this should be checked in JS, but for some reason, my code doesn't work:
The latest update to the DeepL interface added a skeleton display for text that is still being translated. This creates a problem, because deepl-cli does not wait for the entire text to be translated, but copies it as soon as the length of the translated text is > 0 and thus the result contains an incomplete translation and ‘[...]’
I solved this problem in the following way:
Ideally, this should be checked in JS, but for some reason, my code doesn't work: