# 翻译流程

使用好的翻译工作流程可以事半功倍

# 本地化平台离线翻译流程

### 缘由

<div class="paragraph" id="bkmrk-%E6%9C%89%E7%82%B9%E6%87%92-%E5%B0%B1%E8%AE%A9-deepseek-r1-%E6%80%BB">有点懒 就让 DeepSeek-R1 总结了（</div>#### 灵活性与工具适配性

<div class="paragraph" id="bkmrk-%E7%A6%BB%E7%BA%BF%E7%BF%BB%E8%AF%91%E5%85%81%E8%AE%B8%E4%BD%BF%E7%94%A8%E6%9B%B4%E4%B8%93%E4%B8%9A%E7%9A%84%E6%9C%AC%E5%9C%B0%E5%8C%96%E5%B7%A5%E5%85%B7%EF%BC%8C%E8%BF%99%E4%BA%9B">离线翻译允许使用更专业的本地化工具，这些工具支持术语库、翻译记忆库（TM）、机器翻译集成等高级功能，能显著提升翻译效率和一致性。</div>#### 网络与协作限制

<div class="paragraph" id="bkmrk-%E5%9C%A8%E7%BD%91%E7%BB%9C%E4%B8%8D%E5%8F%AF%E9%9D%A0%E6%88%96%E5%8F%97%E9%99%90%E7%9A%84%E6%83%85%E5%86%B5%E4%B8%8B%EF%BC%8C%E4%BD%BF%E7%94%A8%E6%9C%AC%E5%9C%B0%E5%8C%96%E5%B9%B3">在网络不可靠或受限的情况下，使用本地化平台在线翻译可能无法得到流畅的使用体验。</div>#### 性能与效率优化

<div class="paragraph" id="bkmrk-%E5%AF%B9%E4%BA%8E%E8%B6%85%E5%A4%A7%E5%9E%8B%E9%A1%B9%E7%9B%AE%EF%BC%88%E5%A6%82%E6%95%B0%E4%B8%87%E6%9D%A1%E7%BF%BB%E8%AF%91%E9%A1%B9%EF%BC%89%EF%BC%8C%E7%BD%91%E9%A1%B5%E7%AB%AF">对于超大型项目（如数万条翻译项），网页端操作可能卡顿，本地工具处理速度更快。</div>#### 复杂文件处理需求

<div class="paragraph" id="bkmrk-%E6%96%87%E4%BB%B6%E5%8F%AF%E8%83%BD%E9%9C%80%E8%A6%81%E8%84%9A%E6%9C%AC%E5%8C%96%E5%A4%84%E7%90%86%EF%BC%88%E5%A6%82%E6%89%B9%E9%87%8F%E6%9B%BF%E6%8D%A2%E5%8D%A0%E4%BD%8D%E7%AC%A6">文件可能需要脚本化处理（如批量替换占位符、调整变量格式），本地工具（如 Python 脚本、正则表达式工具）更灵活。</div>### 流程

<div class="paragraph" id="bkmrk-%E5%A4%A7%E8%87%B4%E5%88%86%E4%B8%BA%E4%B8%89%E4%B8%AA%E6%AD%A5%E9%AA%A4%EF%BC%9A">大致分为三个步骤：</div>1. 从远程下载模板文件
2. 本地使用相关工具进行翻译（所谓离线只是脱离在线平台，并非不联网）
3. 从本地上传译文文件

<div class="paragraph" id="bkmrk-%E5%85%B6%E4%B8%AD%E5%80%BC%E5%BE%97%E6%B3%A8%E6%84%8F%E7%9A%84%E7%82%B9%EF%BC%9A">其中值得注意的点：</div>- 选择适当翻译格式进行上传/下载，比如 Crowdin/Transifex（付费）仅支持通用格式 XLIFF
- 合理使用客户端，加速操作流程（后面会提及大部分命令行客户端）
- 合理使用辅助翻译工具，加速翻译流程（见 [AI 用于软件翻译流程](https://wiki.qunn.eu/books/fbd79/page/ai)）

### Weblate

#### WEB

<div class="paragraph" id="bkmrk-%E8%A7%81-downloading-and-up">见 [Downloading and uploading translations - Weblate latest documentation](https://docs.weblate.org/en/latest/user/files.html)</div>#### CLI

<div class="paragraph" id="bkmrk-%E4%BD%BF%E7%94%A8-weblateorg%2Fwlc%3A-w">使用 [WeblateOrg/wlc: Weblate command line client](https://github.com/WeblateOrg/wlc)</div>```shell
# https://docs.weblate.org/en/latest/wlc.html#getting-started 
vim ~/.config/weblate

# e.g. weblate/website/zh_Hans
$PROJECT=weblate;$COMPONENT=website;$LANGUAGE=zh_Hans

# show translation progress
wlc [stats/show] $PROJECT/$COMPONENT/$LANGUAGE

# download translation file
wlc download $PROJECT/$COMPONENT/$LANGUAGE -c po -o $PROJECT-$COMPONENT_$LANGUAGE.po

# do some translations here

# upload translation file
wlc upload $PROJECT/$COMPONENT/$LANGUAGE -i $PROJECT-$COMPONENT_$LANGUAGE.po [--method {translate/suggest/fuzzy}]
```

### Crowdin

#### WEB

<div class="paragraph" id="bkmrk-%E8%A7%81-offline-translatio">见 [Offline Translation | Crowdin Docs](https://support.crowdin.com/offline-translation/)</div><div class="paragraph" id="bkmrk-%E4%B8%BA%E4%BA%86%E5%B0%86-xliff-%E6%A0%BC%E5%BC%8F%E8%BD%AC%E8%87%B3%E5%90%88%E9%80%82%E7%9A%84%E7%BF%BB%E8%AF%91%E6%A0%BC"><div class="paragraph">为了将 XLIFF 格式转至合适的翻译格式，推荐配合 [The essential toolkit for localization engineers | Translate Toolkit](https://toolkit.translatehouse.org/)</div></div>#### CLI

<div class="paragraph" id="bkmrk-%E4%BD%BF%E7%94%A8-crowdin%2Fcrowdin-c">使用 [crowdin/crowdin-cli: A command-line client for the Crowdin API](https://github.com/crowdin/crowdin-cli)</div><div class="paragraph" id="bkmrk-%E9%9C%80%E8%A6%81%E5%88%86%E9%A1%B9%E7%9B%AE%E9%85%8D%E7%BD%AE%EF%BC%8C%E8%80%8C%E4%B8%94%E4%B8%8D%E6%94%AF%E6%8C%81%E6%8C%87%E5%AE%9A-xlif">需要分项目配置，而且不支持指定 XLIFF 格式 (?)，不太推荐</div>```shell
# https://crowdin.github.io/crowdin-cli/configuration
crowdin init
# or
export $CROWDIN_PERSONAL_TOKEN=[REDACTED];export $CROWDIN_PROJECT_ID=[REDACTED]

# show translation and proofreading progress
crowdin status -l zh-CN

# download translation file
crowdin download translations -l zh-CN

# do some translations here

# upload translation file
crowdin upload translations -l zh-CN

```

### Transifex

#### WEB

<div class="paragraph" id="bkmrk-%E8%A7%81-translate-offline-">见 [Translate Offline | Transifex Help Center](https://help.transifex.com/en/articles/6240596-translate-offline)</div><div class="paragraph" id="bkmrk-%E4%B8%BA%E4%BA%86%E5%B0%86%E5%8E%9F%E8%B5%84%E6%BA%90%E7%9A%84%E6%A0%BC%E5%BC%8F%EF%BC%88%E6%88%96%E8%AE%A2%E9%98%85%E4%BD%BF%E7%94%A8-xlif"><div class="paragraph">为了将原资源的格式（或订阅使用 XLIFF 格式）转至合适的翻译格式，推荐配合 [The essential toolkit for localization engineers | Translate Toolkit](https://toolkit.translatehouse.org/)</div></div>#### CLI

<div class="paragraph" id="bkmrk-%E4%BD%BF%E7%94%A8-transifex%2Fcli%3A-th">使用 [transifex/cli: The Transifex command-line client](https://github.com/transifex/cli)</div><div class="paragraph" id="bkmrk-%E9%9C%80%E8%A6%81%E5%88%86%E9%A1%B9%E7%9B%AE%E9%85%8D%E7%BD%AE%EF%BC%8C%E8%80%8C%E4%B8%94%E4%BD%BF%E7%94%A8-xliff-%E6%A0%BC">需要分项目配置，而且使用 XLIFF 格式需要订阅，不太推荐</div>```shell
# https://github.com/transifex/cli?tab=readme-ov-file#usage
tx init && vim .tx/config
# or
export $TX_TOKEN=[REDACTED]

# show translation and proofreading progress
tx status [resource_id]

# download translation file
tx pull -l zh-CN

# do some translations here

# upload translation file
tx push -l zh-CN

```

### Translation Project

<div class="paragraph" id="bkmrk-%E5%8F%82%E8%80%83-translators-and-t">参考 [Translators and the TP](https://translationproject.org/html/translators.html)</div>#### CLI

<div class="paragraph" id="bkmrk-%E4%BD%BF%E7%94%A8-translation-softw">使用 [Translation software and other projects](https://translationproject.org/html/software.html)</div>```
./sendpo.sh POFILE
```

# AI 用于软件翻译流程

### 选择翻译格式

<div class="paragraph" id="bkmrk-%E9%A1%BA%E4%BE%BF%E5%88%97%E4%B8%BE%E4%B8%80%E4%BA%9B%E8%B4%A8%E9%87%8F%E8%BE%83%E9%AB%98%E7%9A%84%E9%A1%B9%E7%9B%AE">顺便列举一些质量较高的项目</div>#### 基于 GNU gettext PO

<div class="paragraph" id="bkmrk-gnu-gettext-%E6%98%AF%E4%BD%BF%E7%94%A8%E6%9C%80%E5%B9%BF%E6%B3%9B%E7%9A%84%E8%87%AA">GNU gettext 是使用最广泛的自由软件国际化工具之一，且在 Weblate 中有很好的支持。</div><div class="paragraph" id="bkmrk-%E8%BF%99%E4%B8%AA%E5%9C%A8%E7%94%A8%EF%BC%8C%E5%AD%90%E5%91%BD%E4%BB%A4%E6%AF%94%E8%BE%83%E5%A5%BD%E7%94%A8%EF%BC%8Cprompt-">这个在用，子命令比较好用，prompt 设置合理，支持自定义提示、词典、上下文</div><div class="paragraph" id="bkmrk-ryanhex53%2Fgpt-po%3A-co">[ryanhex53/gpt-po: command tool for translate po files by using openai api](https://github.com/ryanhex53/gpt-po)</div><div class="paragraph" id="bkmrk-%E8%BF%99%E4%B8%AA%E6%9C%89%E5%89%8D%E7%AB%AF%EF%BC%8C%E4%BB%8E-gpt-po-issue">这个有前端，从 gpt-po issue 里看到的</div><div class="paragraph" id="bkmrk-leolivier%2Fauto-po-ly">[leolivier/auto-po-lyglot: The goal of this project is to use various LLMs to help translate po files using a first already translated file to provide context for short pieces of text otherwise very ambiguous.](https://github.com/leolivier/auto-po-lyglot)</div><div class="paragraph" id="bkmrk-%E4%B8%80%E8%88%AC%EF%BC%8C%E4%B8%8D%E8%BF%87%E6%9C%89-pypi">一般，不过有 pypi</div><div class="paragraph" id="bkmrk-pescheckit%2Fpython-gp">[pescheckit/python-gpt-po: This tool, powered by OpenAI's GPT-4, offers a sophisticated approach to translating .po and .mo files, seamlessly integrating the capabilities of ChatGPT and GPT-3.5 models. It's designed for both bulk and individual file translations, providing a versatile solution for different translation needs.](https://github.com/pescheckit/python-gpt-po)</div>#### 基于 XLIFF

<div class="paragraph" id="bkmrk-xliff-%E6%98%AF%E5%9F%BA%E4%BA%8E-xml-%E7%9A%84%E6%A0%BC%E5%BC%8F%EF%BC%8C%E6%97%A8%E5%9C%A8">XLIFF 是基于 XML 的格式，旨在标准化翻译文件（但是版本间都不兼容，pypi 都没解析库），Crowdin、Transifex（付费） 主要用这个导出/入译文进行离线翻译，条目可带有额外的核准状态</div><div class="paragraph" id="bkmrk-%E5%BB%BA%E8%AE%AE%E8%BF%98%E6%98%AF%E8%BD%AC%E6%8D%A2%E5%88%B0-po-files-%E7%BF%BB%E8%AF%91%E5%90%8E">建议还是转换到 PO Files 翻译后再转回去</div>#### 基于 JSON

<div class="paragraph" id="bkmrk-%E8%BF%99%E4%B8%AA%E9%9C%80%E6%B1%82%E6%AF%94%E8%BE%83%E7%89%B9%E6%AE%8A%EF%BC%8C%E4%B8%80%E8%88%AC%E7%94%A8%E4%BA%8E-js-%E7%9B%B8%E5%85%B3%E9%A1%B9">这个需求比较特殊，一般用于 JS 相关项目</div><div class="paragraph" id="bkmrk-mololab%2Fjson-transla">[mololab/json-translator: jsontt 💡 - AI JSON Translator with GPT + other FREE translation modules to translate your json/yaml files into other languages ✅ Check Readme ✌ Supports GPT / DeepL / Google / Bing / Libre / Argos](https://github.com/mololab/json-translator)</div>### 初翻后人工校对

<div class="paragraph" id="bkmrk-%E6%9C%89%E4%BA%9B%E8%A6%81%E7%82%B9%E9%9C%80%E8%A6%81%E6%B3%A8%E6%84%8F%EF%BC%88ai-%E6%97%A0%E6%B3%95%E6%B3%A8%E6%84%8F%E5%88%B0%E7%9A%84%E7%BF%BB%E8%AF%91">有些要点需要注意（AI 无法注意到的翻译规范细节）：</div>- 同一个术语是否翻译的一致（可能会丢失上下文）
- 人称代词、单复数、易错译词（如账号）
- 是否遵循翻译规范（可使用 autocorrect 快速修正）
- 是否丢失空格、换行符、拆行等 AI 无法注意到的细节