|
| 1 | +# Tech Article Translation Agent Guide |
| 2 | + |
| 3 | +This directory contains English tech articles pending translation to Chinese. This document provides guidance for AI coding assistants. |
| 4 | + |
| 5 | +## Translation Quality Standards |
| 6 | + |
| 7 | +- **Accuracy**: Faithfully convey original meaning without omissions or distortions |
| 8 | +- **Fluency**: Output should follow natural Chinese expression patterns |
| 9 | +- **Consistency**: Maintain uniform terminology throughout the article |
| 10 | +- **Completeness**: Preserve code examples, links, and document structure |
| 11 | + |
| 12 | +## Chunked Translation Strategy (For 300+ Line Articles) |
| 13 | + |
| 14 | +Long articles exceed single conversation context limits. Chunked processing ensures translation quality. |
| 15 | + |
| 16 | +### Step 1: Analyze Article Structure |
| 17 | + |
| 18 | +1. Read the full article, identify main sections (typically `##` headings) |
| 19 | +2. Count total lines and lines per section |
| 20 | +3. Divide article into translation units at section boundaries, each 200-300 lines |
| 21 | + |
| 22 | +### Step 2: Build Glossary |
| 23 | + |
| 24 | +Before translating, scan the full text to extract key terms: |
| 25 | + |
| 26 | +```markdown |
| 27 | +## Glossary |
| 28 | + |
| 29 | +| English Term | Chinese Translation | Notes | |
| 30 | +|-------------|---------------------|-------| |
| 31 | +| Shadow DOM | 影子 DOM | Web Components term | |
| 32 | +| Custom Element | 自定义元素 | | |
| 33 | +| hydration | 水合 | React/SSR term | |
| 34 | +``` |
| 35 | + |
| 36 | +Use this glossary as reference to ensure consistency across the article. |
| 37 | + |
| 38 | +### Step 3: Translate by Chunks |
| 39 | + |
| 40 | +For each translation unit: |
| 41 | + |
| 42 | +1. **Read the section's original text** |
| 43 | +2. **Translate with glossary reference** |
| 44 | +3. **Edit the original file directly**, replacing English with Chinese |
| 45 | +4. **Keep code blocks unchanged** |
| 46 | +5. Proceed to next section |
| 47 | + |
| 48 | +### Step 4: Integration Check |
| 49 | + |
| 50 | +After translation: |
| 51 | + |
| 52 | +1. Read through entire article for coherence |
| 53 | +2. Verify terminology consistency |
| 54 | +3. Update front matter |
| 55 | +4. Move file to `_posts/Article/Translation/` |
| 56 | + |
| 57 | +## Translation Unit Template |
| 58 | + |
| 59 | +Each translation unit should be tracked as: |
| 60 | + |
| 61 | +``` |
| 62 | +=== Translation Unit [N/Total] === |
| 63 | +Section: [Section Title] |
| 64 | +Line Range: [Start-End] |
| 65 | +Status: [Pending/In Progress/Completed] |
| 66 | +=== |
| 67 | +``` |
| 68 | + |
| 69 | +## Content Cleanup Rules |
| 70 | + |
| 71 | +Remove the following during translation: |
| 72 | + |
| 73 | +- Navigation breadcrumbs (e.g., `- [Home][1] - [Docs][2]`) |
| 74 | +- Author avatars and social links |
| 75 | +- Page metadata prompts (e.g., "Stay organized with collections...") |
| 76 | +- Duplicate titles (keep one) |
| 77 | + |
| 78 | +## Content to Preserve |
| 79 | + |
| 80 | +- All code blocks (keep as-is) |
| 81 | +- `<!-- more -->` excerpt separator |
| 82 | +- Footnote link references (`[1]: https://...`) |
| 83 | +- Image references |
| 84 | + |
| 85 | +## Translation Style Guide |
| 86 | + |
| 87 | +### Terminology Handling |
| 88 | + |
| 89 | +``` |
| 90 | +First occurrence: 服务端渲染(Server-Side Rendering,SSR) |
| 91 | +Subsequent uses: 服务端渲染 or SSR |
| 92 | +``` |
| 93 | + |
| 94 | +### Punctuation |
| 95 | + |
| 96 | +- Use Chinese punctuation: ,。!?:;""'' |
| 97 | +- Use English punctuation for code-related content |
| 98 | + |
| 99 | +### Paragraph Format |
| 100 | + |
| 101 | +- Maintain original paragraph structure |
| 102 | +- Split overly long sentences for readability when appropriate |
| 103 | + |
| 104 | +## Example: Translation Workflow |
| 105 | + |
| 106 | +Using `declarative-shadow-dom.md` (332 lines) as example: |
| 107 | + |
| 108 | +``` |
| 109 | +1. Analyze structure: |
| 110 | + - Front Matter: lines 1-9 |
| 111 | + - Introduction: lines 10-54 → Unit 1 |
| 112 | + - Building a Declarative Shadow Root: lines 55-82 → Unit 2 |
| 113 | + - Component hydration: lines 83-151 → Unit 3 |
| 114 | + - Remaining sections... → Units 4-N |
| 115 | +
|
| 116 | +2. Build glossary: |
| 117 | + | Shadow DOM | 影子 DOM | |
| 118 | + | Declarative Shadow Root | 声明式影子根 | |
| 119 | + | Custom Element | 自定义元素 | |
| 120 | + | slot | 插槽 | |
| 121 | +
|
| 122 | +3. Translate unit by unit, editing file directly |
| 123 | +
|
| 124 | +4. Final review and move file |
| 125 | +``` |
| 126 | + |
| 127 | +## Common Technical Terms Reference |
| 128 | + |
| 129 | +| English | Recommended Chinese | |
| 130 | +|---------|---------------------| |
| 131 | +| Shadow DOM | 影子 DOM | |
| 132 | +| Web Components | Web 组件 | |
| 133 | +| Custom Elements | 自定义元素 | |
| 134 | +| Server-Side Rendering | 服务端渲染 | |
| 135 | +| hydration | 水合/激活 | |
| 136 | +| streaming | 流式传输 | |
| 137 | +| polyfill | 垫片/polyfill | |
| 138 | +| slot | 插槽 | |
| 139 | +| encapsulation | 封装 | |
| 140 | +| DOM tree | DOM 树 | |
| 141 | +| API | API | |
| 142 | +| callback | 回调 | |
| 143 | +| async/await | async/await | |
| 144 | +| middleware | 中间件 | |
| 145 | +| container | 容器 | |
| 146 | +| orchestration | 编排 | |
| 147 | +| deployment | 部署 | |
| 148 | +| CI/CD | CI/CD | |
0 commit comments