|
4 | 4 |
|
5 | 5 | 该工具提供两种工作模式: |
6 | 6 |
|
7 | | -1. **全量翻译** - 完整文档转换 |
8 | | -2. **增量翻译** - 基于变更的本地化 |
| 7 | +1. **全量翻译** - 完整文档翻译 |
| 8 | +2. **增量翻译** - 按需进行局部翻译 |
9 | 9 |
|
10 | 10 | ## 全量翻译的输入输出规范 |
11 | 11 |
|
|
150 | 150 |
|
151 | 151 | - Markdown:保留标题层级、代码块、列表结构、链接锚点 |
152 | 152 | - JSON:保持键名不变,仅翻译值(含转义字符处理) |
153 | | -- 注释标记:保留 <!-- i18n-ignore --> 等标记的原始位置 |
| 153 | +- 注释标记:保留 `<!-- i18n-ignore -->` 等标记的原始位置 |
154 | 154 | - capable of translating texts accurately into the specified target language, |
155 | 155 | - preserving technical terms, code snippets, markdown formatting, and platform-specific language. |
156 | 156 | - Do not add any explanations or annotations to the translated text. |
157 | 157 |
|
158 | 158 | 2. 标记处理: |
159 | | -• 忽略区块: |
160 | | -<!-- i18n-ignore-start -->...<!-- i18n-ignore-end --> → 保持原样 |
161 | 159 |
|
162 | | -• 本土化标记: |
163 | | - |
164 | | -<!-- i11n-start: {提示} -->...<!-- i11n-end --> → |
165 | | - |
166 | | -- 根据提示进行创意改编(如:中文成语 → 等效英文谚语) |
167 | | -- 在翻译后添加 <!-- i11n-reason: 改编说明 --> |
| 160 | + - 忽略区块: |
| 161 | + `<!-- i18n-ignore-start -->...<!-- i18n-ignore-end -->` → 保持原样 |
| 162 | + - 本土化标记: |
| 163 | + `<!-- i11n-start: {提示} -->...<!-- i11n-end -->` → |
| 164 | + - 根据提示进行创意改编(如:中文成语 → 等效英文谚语) |
| 165 | + - 在翻译后,在`<!-- i11n-end -->`前面添加 `<!-- i11n-reason: 改编说明 -->` |
168 | 166 |
|
169 | 167 | 3. JSON 特殊字段: |
170 | | - "//key": ["i18n-ignore"] → 跳过对应键值的翻译 |
171 | | - "//key": ["i11n: 提示"] → 按提示本地化翻译,保留原始键 |
172 | 168 |
|
173 | | -4. 混合内容处理: |
174 | | - [中文](原文) → [英文](翻译) // 保留注释 |
175 | | - "key": "值" // 保留行尾注释 |
| 169 | + - "//key": ["i18n-ignore"] → 跳过对应键值的翻译 |
| 170 | + - "//key": ["i11n: 提示"] → 按提示本地化翻译,保留原始键 |
176 | 171 |
|
177 | | -5. 对于增量翻译模式,需要理解参数和返回值的含义: |
| 172 | +4. 对于增量翻译模式,需要理解参数和返回值的含义: |
178 | 173 | - 首先是 changes 参数,它是指某一个文件的变更记录,使用`git diff`获得的差异信息 |
179 | 174 | - 然后是 files 参数,是指其它没有变更的文件。 |
180 | 175 | - 最后关于返回值 files,会有两种格式: |
|
0 commit comments