来源:
doc/TRANSLATING.md
.github/workflows/build-translations.yml
lang/Makefile
src/translations.h
commit d32b9cc880a8
build-config
翻译流程¶
本页描述生产 translation asset;运行时 localization 语义另有页面,这里以构建文件与 translation workflow 为权威。
从源码到运行时¶
- C++ 字符串使用 translation helper,受支持 JSON type 使用
translationfield; lang/update_pot.sh与 JSON extractor 生成源模板;- 译者在已配置 CCB Transifex project 工作;
.github/workflows/build-translations.yml拉取 PO、拒绝无效条目、更新统计、编译 MO, 并发布 translation artifact;- 各平台 build 消费 artifact,
src/translations.*选择并缓存语言。
贡献规则¶
有歧义英文使用 context,计数消息使用 plural helper。保持 placeholder、markup token、 换行与语义 context 稳定。不要手改明确标为 generated 的文件,也不要用上游 resource 名称替换 CCB 项目身份。
本地检查¶
仓库聚焦编译入口为:
提取与完整 catalog refresh 可能触碰大量文件和外部 translation state;按修改运行准确 workflow,审查 PO/POT diff;没有 credential 与 log 时不能声称完成 Transifex pull。
验证¶
检查 extraction、invalid PO handling、MO compilation、placeholder parity、plural/context、 localized build 与窄宽度代表性 UI。Android resource string 与 Lua i18n 是额外 pipeline, 修改时单独验证。
归属与维护¶
保留译者 credit 与来源。translation service credential 只放 repository secret。外部拉取 失败不能靠发布空/旧 artifact 隐藏;复用可信默认分支 artifact 必须在 CI log 明示。