Skip to content

fix: update new_p.string when resuming with single_translate#489

Merged
yihong0618 merged 1 commit intoyihong0618:mainfrom
bosens-China:fix-resume-single-translate-bug
Feb 25, 2026
Merged

fix: update new_p.string when resuming with single_translate#489
yihong0618 merged 1 commit intoyihong0618:mainfrom
bosens-China:fix-resume-single-translate-bug

Conversation

@bosens-China
Copy link
Contributor

When using --resume with --single_translate, the cached translation
was loaded into p.string but new_p.string was still the original text.
This caused insert_trans to receive the original text instead of the
translation, resulting in English output instead of Chinese.


Bug 描述
使用 --resume--single_translate 参数时,输出的仍是英文原文而非中文翻译。

根因
_process_paragraph 中恢复缓存时只更新了 p.string,但 insert_trans 使用的是 new_p.string

修复
在 resume 时也同步更新 new_p.string

  When using --resume with --single_translate, the cached translation
  was loaded into p.string but new_p.string was still the original text.
  This caused insert_trans to receive the original text instead of the
  translation, resulting in English output instead of Chinese.
@yihong0618
Copy link
Owner

nice catch

@yihong0618 yihong0618 merged commit 7d6bedb into yihong0618:main Feb 25, 2026
1 of 2 checks passed
@bosens-China bosens-China deleted the fix-resume-single-translate-bug branch February 28, 2026 06:35
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

Successfully merging this pull request may close these issues.

2 participants