machinewrapped / gpt-subtrans

Open Source project using LLMs to translate SRT subtitles
Other
347 stars 40 forks source link

After I tried to modify the translation myself and save the project, the subtrans file was modified incorrectly #31

Closed Cl4ySmith closed 9 months ago

Cl4ySmith commented 1 year ago

In the subtrans file after I saved it, for the batch I modified manually, first the all_translated attribute is missing, then there is an originals attribute but no translated attribute, I need to modify the file to add "all_translated": true and " translated": [...]. This way the translated batch will show up properly in the software and then I can save it again to get the translated full subtitle file.

machinewrapped commented 1 year ago

Thanks for the report, I'll take a look. Could you give a little more information about what you did - had the batch already been translated automatically, then you edited a translation, or were you adding new translations by hand?

The all_translated property is "write-only" in the project, it's only there for information and is always recalculated at runtime.

Cl4ySmith commented 1 year ago

All other batches were translated automatically, except for one that failed. I don’t remember the error message, but it returned the result from GPT with both the original text and the translation.

So what I did was, I copied the translation, double-clicked the original text and pasted the translation into translated_text, then clicked OK. After finishing this batch, I clicked the Save button in the upper left corner, and then I saw a message below saying that the subtrans file and the -ChatGPT.srt file were written successfully.

However, when I opened the subtrans file again, the batch that I manually translated was still untranslated. Then I checked the subtrans and subtrans-backup files, and I found that the translated property was missing.

PS: I tried to re-translate the original srt file from scratch, and it did not produce the same error as yesterday. The batch that could not be translated yesterday was successfully translated automatically this time.

machinewrapped commented 1 year ago

Thanks, I'll see if I can reproduce the issue - glad to hear the second attempt was more successful :-)