This dir is a collection of scripts to help translate desc.en.hocon to desc.zh.hocon.
-
Run
0-sync-en.shto sync the en docs from emqx.git. -
Run
1-compare.shto run a 3-way compare betweendesc.en.hocon,desc.zh.hoconanddesc.base.hocon. The diff is saved intotmp/desc.diff.hocon. The diff rules are:- If a doc changed from
desc.base.hocontodesc.en.hocon, a comment#NEED_TRANSLATION: CHANGED_SINCE <old_version>is added, followed by the old version doc, the new version doc and the new version doc in zh. - If a doc is missing in
desc.zh.hocon, a the doc content is added asDOC_ID = NEED_TRANSLATION.
- If a doc changed from
-
Run
2-translate.pyto translate the diff file. -
2-translate.pyuses OpenAI Responses API and defaults to modelgpt-5.2-codex. Model precedence is:--model>OPENAI_MODEL> default. -
Run
3-commit.shto concatenate the translated diff intodesc.zh.hocon, then re-format the file and commit it into git.
The steps can be run in one go in CI.
./tr/run.sh --emqx-ref <emqx.git-branch-or-tag> --compare-base <this-repo-translation-compare-base> [--model <openai-model>] [--dryrun]
Example:
./tr/run.sh --emqx-ref master --compare-base v5.9.0 --model gpt-5.2-codex