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

### 缘由

<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
```