refactor(baoyu-translate): simplify translation prompts and workflow

Condense 15+ verbose translation principles to 7 concise ones.
Consolidate analysis from 8 sections to 4, review from 8 to 3.
Simplify subagent prompt template accordingly.
This commit is contained in:
Jim Liu 宝玉
2026-03-26 23:02:28 -05:00
parent 9137c5ab8c
commit 31994be0e1
3 changed files with 81 additions and 240 deletions
@@ -15,65 +15,39 @@ Replace `{placeholders}` with actual values. Omit sections marked "if analysis e
```markdown
You are a professional translator. Your task is to translate markdown content from {source_lang} to {target_lang}.
## Target Audience
## Target Audience & Style
{audience description}
## Translation Style
**Audience**: {audience description}
**Target style**: {style description — e.g., "storytelling: engaging narrative flow, smooth transitions, vivid phrasing" or custom style from user}
**Source voice** (from analysis, if exists): {Describe the original author's voice — e.g., "Self-deprecating, conversational tone with frequent tech-industry humor. Sarcasm used to critique trends. Short punchy sentences alternate with longer analytical passages." Include: formal/conversational, humor type, cultural register, sentence rhythm, any distinctive patterns.}
Apply the target style consistently while respecting the source voice. The translator should understand what the original sounds like in order to produce a translation that captures the same feel in the target style. Style is independent of audience — a technical audience can still get a storytelling-style translation, or a general audience can get a formal one.
**Source voice** (from analysis, if exists): {Brief description of the original author's voice — formal/conversational, humor, register, sentence rhythm.}
## Content Background
{Inlined from 01-analysis.md if analysis exists: quick summary, core argument, author background, writing context, purpose, implicit assumptions.}
{Inlined from 01-analysis.md if analysis exists: content summary, core argument, author background, context.}
## Glossary
Apply these term translations consistently throughout. First occurrence of each term: include the original in parentheses after the translation.
Apply these term translations consistently. First occurrence: include original in parentheses.
{Merged glossary — combine built-in glossary + EXTEND.md glossary + terms extracted in analysis. One per line: English → Translation}
## Figurative Language Mapping
{Inlined from 01-analysis.md section 1.7 if analysis exists. Structured table — one row per metaphor, idiom, or figurative expression identified in the source:}
| Original Expression | Intended Meaning | Approach | Suggested Rendering |
|--------------------|--------------------|----------|---------------------|
| {source metaphor} | {what the author actually means} | {Interpret / Substitute / Retain} | {target-language rendering or guidance} |
Also note any emotional connotations (words carrying subjective feeling beyond dictionary meaning) and implied meanings (sentences where surface meaning is simpler than the author's full intent) identified in the analysis — preserve these in translation.
## Comprehension Challenges
The following terms or references may confuse target readers. Add translator's notes in parentheses where they appear: `译文(English original,通俗解释)`
{Inlined from 01-analysis.md comprehension challenges section if analysis exists. Each entry includes the reasoning so the translator can calibrate annotation depth:}
- **{term/passage}**: {why this may confuse target readers} → Note: {concise explanation to use as translator's note}
{Merged glossary — one per line: English → Translation}
## Translation Challenges
{Inlined from 01-analysis.md section 1.8 if analysis exists. Specific passages requiring structural or creative adaptation:}
{Inlined from 01-analysis.md §1.4 if analysis exists. Comprehension gaps, figurative language, structural challenges with suggested approaches:}
- {location/passage}: {what makes it challenging — e.g., 60-word participial chain, wordplay, pun, author's signature humor} → {suggested approach — e.g., break into 2-3 shorter sentences, adapt the joke for target culture, preserve the ambiguity}
If this section is empty, omit it.
- **{term/passage}**: {challenge type} → {suggested approach}
## Translation Principles
Rewrite the content into natural, engaging {target_lang} — not merely translate it. Every sentence should read as if a skilled native writer composed it from scratch.
- **Accuracy first**: Facts, data, and logic must match the original exactly
- **Meaning over words**: Translate what the author means, not just what the words say. When a literal translation sounds unnatural or fails to convey the intended effect, restructure freely to express the same meaning in idiomatic {target_lang}
- **Figurative language**: Interpret metaphors, idioms, and figurative expressions by their intended meaning. When a source-language image does not carry the same connotation in {target_lang}, replace it with a natural expression that conveys the same idea and emotional effect. Follow the Figurative Language Mapping table above for pre-analyzed decisions
- **Emotional fidelity**: Preserve the emotional connotations of word choices, not just their dictionary meanings
- **Natural flow**: Use idiomatic {target_lang} word order and sentence patterns; break or restructure sentences freely when the source structure doesn't work naturally
- **Terminology**: Use glossary translations consistently; annotate with original term in parentheses on first occurrence
- **Natural flow**: Use idiomatic {target_lang} word order. Break long source sentences into shorter, natural ones. Interpret metaphors and idioms by intended meaning, not word-for-word
- **Terminology**: Use glossary translations consistently. Annotate with original in parentheses on first occurrence of specialized terms
- **Preserve format**: Keep all markdown formatting (headings, bold, italic, images, links, code blocks)
- **Respect original**: Maintain original meaning and intent; do not add, remove, or editorialize — but sentence structure and imagery may be adapted freely to serve the meaning
- **Translator's notes**: For terms or cultural references listed in Comprehension Challenges above, add a concise explanatory note in parentheses. Use the provided reasoning to judge annotation depth — explain more for genuinely obscure references, less for terms that are merely unfamiliar. Only annotate where genuinely needed for the target audience.
- **Proactive interpretation**: For jargon or concepts the target audience may lack context for, add concise explanations in **bold parentheses** `**解释**`. Keep annotations few — only where genuinely needed
```
---
@@ -86,7 +60,7 @@ If this section is empty, omit it.
Read the translation instructions from: {output_dir}/02-prompt.md
You are translating chunk {NN} of {total_chunks}.
Context: {brief description of what this chunk covers and where it sits in the overall argument — e.g., "This chunk covers the author's critique of current approaches, following the introduction of the problem and leading into the proposed solution."}
Context: {brief description of what this chunk covers and where it sits in the overall argument}
Translate this chunk:
1. Read `{output_dir}/chunks/chunk-{NN}.md`