Skip to content

Claude/fix zhipu translation saving 01 s hd pa z ej5q7wgbie h zv s qi#480

Closed
wafkaw wants to merge 2 commits intoyihong0618:mainfrom
wafkaw:claude/fix-zhipu-translation-saving-01SHdPaZEj5q7wgbieHZvSQi
Closed

Claude/fix zhipu translation saving 01 s hd pa z ej5q7wgbie h zv s qi#480
wafkaw wants to merge 2 commits intoyihong0618:mainfrom
wafkaw:claude/fix-zhipu-translation-saving-01SHdPaZEj5q7wgbieHZvSQi

Conversation

@wafkaw
Copy link

@wafkaw wafkaw commented Nov 16, 2025

No description provided.

wafkaw and others added 2 commits November 16, 2025 14:57
When using batch translation (translate_list), if some paragraphs fail
to translate properly, an empty string is returned. This caused the
insert_trans method to:
1. Create a new paragraph with empty translation
2. Remove the original paragraph
3. Result: original text is lost

Fix by checking if translation text is empty before inserting. If empty:
- In single-translate mode: keep original text, don't remove it
- In bilingual mode: don't insert empty translation

This particularly affects Zhipu AI translations when content filtering
or extraction errors occur.
@wafkaw wafkaw closed this Nov 16, 2025
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