翻译流程

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

本地化平台离线翻译流程

缘由

有点懒 就让 DeepSeek-R1 总结了(

灵活性与工具适配性

离线翻译允许使用更专业的本地化工具,这些工具支持术语库、翻译记忆库(TM)、机器翻译集成等高级功能,能显著提升翻译效率和一致性。

网络与协作限制

在网络不可靠或受限的情况下,使用本地化平台在线翻译可能无法得到流畅的使用体验。

性能与效率优化

对于超大型项目(如数万条翻译项),网页端操作可能卡顿,本地工具处理速度更快。

复杂文件处理需求

文件可能需要脚本化处理(如批量替换占位符、调整变量格式),本地工具(如 Python 脚本、正则表达式工具)更灵活。

流程

大致分为三个步骤:
  1. 从远程下载模板文件
  2. 本地使用相关工具进行翻译(所谓离线只是脱离在线平台,并非不联网)
  3. 从本地上传译文文件
其中值得注意的点:

Weblate

WEB

Downloading and uploading translations - Weblate latest documentation

CLI

使用 WeblateOrg/wlc: Weblate command line client
# 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

Offline Translation | Crowdin Docs
为了将 XLIFF 格式转至合适的翻译格式,推荐配合 The essential toolkit for localization engineers | Translate Toolkit

CLI

使用 crowdin/crowdin-cli: A command-line client for the Crowdin API
需要分项目配置,而且不支持指定 XLIFF 格式 (?),不太推荐
# 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

Translate Offline | Transifex Help Center
为了将原资源的格式(或订阅使用 XLIFF 格式)转至合适的翻译格式,推荐配合 The essential toolkit for localization engineers | Translate Toolkit

CLI

使用 transifex/cli: The Transifex command-line client
需要分项目配置,而且使用 XLIFF 格式需要订阅,不太推荐
# 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

参考 Translators and the TP

CLI

使用 Translation software and other projects
./sendpo.sh POFILE

AI 用于软件翻译流程

选择翻译格式

顺便列举一些质量较高的项目

基于 GNU gettext PO

GNU gettext 是使用最广泛的自由软件国际化工具之一,且在 Weblate 中有很好的支持。
这个在用,子命令比较好用,prompt 设置合理,支持自定义提示、词典、上下文
ryanhex53/gpt-po: command tool for translate po files by using openai api
这个有前端,从 gpt-po issue 里看到的
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.
一般,不过有 pypi
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.

基于 XLIFF

XLIFF 是基于 XML 的格式,旨在标准化翻译文件(但是版本间都不兼容,pypi 都没解析库),Crowdin、Transifex(付费) 主要用这个导出/入译文进行离线翻译,条目可带有额外的核准状态
建议还是转换到 PO Files 翻译后再转回去

基于 JSON

这个需求比较特殊,一般用于 JS 相关项目
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

初翻后人工校对

有些要点需要注意(AI 无法注意到的翻译规范细节):