From b9d26fd1a4101065f682441337da0b08dd7be4d2 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 5 Apr 2026 12:37:07 +0100 Subject: [PATCH] docs: add arabic locale scaffolding --- .../docs-translate-trigger-release.yml | 3 ++- AGENTS.md | 6 +++--- docs/.i18n/README.md | 10 +++++----- docs/.i18n/ar-navigation.json | 18 ++++++++++++++++++ docs/.i18n/glossary.ar.json | 5 +++++ scripts/docs-sync-publish.mjs | 1 + 6 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 docs/.i18n/ar-navigation.json create mode 100644 docs/.i18n/glossary.ar.json diff --git a/.github/workflows/docs-translate-trigger-release.yml b/.github/workflows/docs-translate-trigger-release.yml index c7a9b9c487b..c8ce379a4c0 100644 --- a/.github/workflows/docs-translate-trigger-release.yml +++ b/.github/workflows/docs-translate-trigger-release.yml @@ -25,7 +25,8 @@ jobs: translate-pt-br-release \ translate-ko-release \ translate-de-release \ - translate-fr-release + translate-fr-release \ + translate-ar-release do gh api repos/openclaw/docs/dispatches \ --method POST \ diff --git a/AGENTS.md b/AGENTS.md index 26ff2d01d69..360f6a6b8a7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -83,11 +83,11 @@ ## Docs i18n (generated publish locales) -- Generated publish output lives in the sibling `openclaw-docs` repo; do not add or edit `docs/zh-CN/**`, `docs/ja-JP/**`, `docs/es/**`, `docs/pt-BR/**`, `docs/ko/**`, `docs/de/**`, or `docs/fr/**` here. -- Pipeline: update English docs here → adjust glossary (`docs/.i18n/glossary.zh-CN.json`, `docs/.i18n/glossary.ja-JP.json`, `docs/.i18n/glossary.es.json`, `docs/.i18n/glossary.pt-BR.json`, `docs/.i18n/glossary.ko.json`, `docs/.i18n/glossary.de.json`, `docs/.i18n/glossary.fr.json`) → let the publish-repo sync + `scripts/docs-i18n` run in `openclaw-docs` → apply targeted fixes only if instructed. +- Generated publish output lives in the sibling `openclaw-docs` repo; do not add or edit `docs/zh-CN/**`, `docs/ja-JP/**`, `docs/es/**`, `docs/pt-BR/**`, `docs/ko/**`, `docs/de/**`, `docs/fr/**`, or `docs/ar/**` here. +- Pipeline: update English docs here → adjust glossary (`docs/.i18n/glossary.zh-CN.json`, `docs/.i18n/glossary.ja-JP.json`, `docs/.i18n/glossary.es.json`, `docs/.i18n/glossary.pt-BR.json`, `docs/.i18n/glossary.ko.json`, `docs/.i18n/glossary.de.json`, `docs/.i18n/glossary.fr.json`, `docs/.i18n/glossary.ar.json`) → let the publish-repo sync + `scripts/docs-i18n` run in `openclaw-docs` → apply targeted fixes only if instructed. - Before rerunning `scripts/docs-i18n`, add glossary entries for any new technical terms, page titles, or short nav labels that must stay in English or use a fixed translation (for example `Doctor` or `Polls`). - `pnpm docs:check-i18n-glossary` enforces glossary coverage for changed English doc titles and short internal doc labels before translation reruns. -- Translation memory: locale TM files such as `docs/.i18n/zh-CN.tm.jsonl`, `docs/.i18n/ja-JP.tm.jsonl`, `docs/.i18n/es.tm.jsonl`, `docs/.i18n/pt-BR.tm.jsonl`, `docs/.i18n/ko.tm.jsonl`, `docs/.i18n/de.tm.jsonl`, and `docs/.i18n/fr.tm.jsonl` (generated in the publish repo). +- Translation memory: locale TM files such as `docs/.i18n/zh-CN.tm.jsonl`, `docs/.i18n/ja-JP.tm.jsonl`, `docs/.i18n/es.tm.jsonl`, `docs/.i18n/pt-BR.tm.jsonl`, `docs/.i18n/ko.tm.jsonl`, `docs/.i18n/de.tm.jsonl`, `docs/.i18n/fr.tm.jsonl`, and `docs/.i18n/ar.tm.jsonl` (generated in the publish repo). - See `docs/.i18n/README.md`. - The pipeline can be slow/inefficient; if it’s dragging, ping @jospalmbier on Discord instead of hacking around it. diff --git a/docs/.i18n/README.md b/docs/.i18n/README.md index 58f13e25f0a..e0c40b671a0 100644 --- a/docs/.i18n/README.md +++ b/docs/.i18n/README.md @@ -11,7 +11,7 @@ Generated locale trees and live translation memory now live in the publish repo: - English docs are authored in `openclaw/openclaw`. - The source docs tree lives under `docs/`. -- The source repo no longer keeps committed generated locale trees such as `docs/zh-CN/**`, `docs/ja-JP/**`, `docs/es/**`, `docs/pt-BR/**`, `docs/ko/**`, `docs/de/**`, or `docs/fr/**`. +- The source repo no longer keeps committed generated locale trees such as `docs/zh-CN/**`, `docs/ja-JP/**`, `docs/es/**`, `docs/pt-BR/**`, `docs/ko/**`, `docs/de/**`, `docs/fr/**`, or `docs/ar/**`. ## End-to-end flow @@ -21,7 +21,7 @@ Generated locale trees and live translation memory now live in the publish repo: 4. The sync script rewrites the publish `docs/docs.json` so the generated locale picker blocks exist there even though they are no longer committed in the source repo. 5. `openclaw/docs/.github/workflows/translate-zh-cn.yml` refreshes `docs/zh-CN/**` once a day, on demand, and after source-repo release dispatches. 6. `openclaw/docs/.github/workflows/translate-ja-jp.yml` does the same for `docs/ja-JP/**`. -7. `openclaw/docs/.github/workflows/translate-es.yml`, `translate-pt-br.yml`, `translate-ko.yml`, `translate-de.yml`, and `translate-fr.yml` do the same for `docs/es/**`, `docs/pt-BR/**`, `docs/ko/**`, `docs/de/**`, and `docs/fr/**`. +7. `openclaw/docs/.github/workflows/translate-es.yml`, `translate-pt-br.yml`, `translate-ko.yml`, `translate-de.yml`, `translate-fr.yml`, and `translate-ar.yml` do the same for `docs/es/**`, `docs/pt-BR/**`, `docs/ko/**`, `docs/de/**`, `docs/fr/**`, and `docs/ar/**`. ## Why the split exists @@ -32,10 +32,10 @@ Generated locale trees and live translation memory now live in the publish repo: ## Files in this folder - `glossary..json` — preferred term mappings used as prompt guidance. -- `de-navigation.json`, `es-navigation.json`, `fr-navigation.json`, `ja-navigation.json`, `ko-navigation.json`, `pt-BR-navigation.json`, `zh-Hans-navigation.json` — Mintlify locale picker blocks reinserted into the publish repo during sync. +- `ar-navigation.json`, `de-navigation.json`, `es-navigation.json`, `fr-navigation.json`, `ja-navigation.json`, `ko-navigation.json`, `pt-BR-navigation.json`, `zh-Hans-navigation.json` — Mintlify locale picker blocks reinserted into the publish repo during sync. - `.tm.jsonl` — translation memory keyed by workflow + model + text hash. -In this repo, generated locale TM files such as `docs/.i18n/zh-CN.tm.jsonl`, `docs/.i18n/ja-JP.tm.jsonl`, `docs/.i18n/es.tm.jsonl`, `docs/.i18n/pt-BR.tm.jsonl`, `docs/.i18n/ko.tm.jsonl`, `docs/.i18n/de.tm.jsonl`, and `docs/.i18n/fr.tm.jsonl` are intentionally no longer committed. +In this repo, generated locale TM files such as `docs/.i18n/zh-CN.tm.jsonl`, `docs/.i18n/ja-JP.tm.jsonl`, `docs/.i18n/es.tm.jsonl`, `docs/.i18n/pt-BR.tm.jsonl`, `docs/.i18n/ko.tm.jsonl`, `docs/.i18n/de.tm.jsonl`, `docs/.i18n/fr.tm.jsonl`, and `docs/.i18n/ar.tm.jsonl` are intentionally no longer committed. ## Glossary format @@ -61,7 +61,7 @@ Fields: - If the pending count is `0`, the expensive translation step is skipped entirely. - If there are pending files, the workflow translates only those files. - The publish workflow retries transient model-format failures, but unchanged files stay skipped because the same hash check runs on each retry. -- The source repo also dispatches zh-CN, ja-JP, es, pt-BR, ko, de, and fr refreshes after published GitHub releases so release docs can catch up without waiting for the daily cron. +- The source repo also dispatches zh-CN, ja-JP, es, pt-BR, ko, de, fr, and ar refreshes after published GitHub releases so release docs can catch up without waiting for the daily cron. ## Operational notes diff --git a/docs/.i18n/ar-navigation.json b/docs/.i18n/ar-navigation.json new file mode 100644 index 00000000000..18dad62b494 --- /dev/null +++ b/docs/.i18n/ar-navigation.json @@ -0,0 +1,18 @@ +{ + "language": "ar", + "tabs": [ + { + "tab": "ابدأ", + "groups": [ + { + "group": "نظرة عامة", + "pages": ["ar/index"] + }, + { + "group": "الخطوات الأولى", + "pages": ["ar/start/getting-started", "ar/start/wizard"] + } + ] + } + ] +} diff --git a/docs/.i18n/glossary.ar.json b/docs/.i18n/glossary.ar.json new file mode 100644 index 00000000000..461226c5a1f --- /dev/null +++ b/docs/.i18n/glossary.ar.json @@ -0,0 +1,5 @@ +[ + { "source": "CLI", "target": "CLI" }, + { "source": "Mintlify", "target": "Mintlify" }, + { "source": "OpenClaw", "target": "OpenClaw" } +] diff --git a/scripts/docs-sync-publish.mjs b/scripts/docs-sync-publish.mjs index 48c8aa65a29..ae976c28773 100644 --- a/scripts/docs-sync-publish.mjs +++ b/scripts/docs-sync-publish.mjs @@ -22,6 +22,7 @@ const GENERATED_LOCALES = [ { language: "ko", dir: "ko", navFile: "ko-navigation.json", tmFile: "ko.tm.jsonl" }, { language: "de", dir: "de", navFile: "de-navigation.json", tmFile: "de.tm.jsonl" }, { language: "fr", dir: "fr", navFile: "fr-navigation.json", tmFile: "fr.tm.jsonl" }, + { language: "ar", dir: "ar", navFile: "ar-navigation.json", tmFile: "ar.tm.jsonl" }, ]; function parseArgs(argv) {