Skip to content

Commit 6107a94

Browse files
committed
Trim the translation tooling to what publishing needs
Drops the dispatch workflow and the issue form, the translate flags that served them (--grep, --limit, --dry-run), the reviewers field, the extra exit-code and schema-validation plumbing, and the link-resolution machinery in stage: a translation that no longer fits the current English page is simply served in English with the notice. What remains is translate, stage and status plus the build wiring.
1 parent c65a026 commit 6107a94

16 files changed

Lines changed: 263 additions & 1186 deletions

File tree

‎.github/ISSUE_TEMPLATE/translation.yaml‎

Lines changed: 0 additions & 54 deletions
This file was deleted.

‎.github/workflows/translate.yml‎

Lines changed: 0 additions & 184 deletions
This file was deleted.

‎docs/translations.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ Translated pages are machine-generated by a tool in this repository from the Eng
2222

2323
## Reporting a translation problem
2424

25-
Found a wrong term, an awkward sentence, or a translation that says something the English doesn't? [Open a translation issue](https://github.com/modelcontextprotocol/python-sdk/issues/new?template=translation.yaml) with the language, the page and the passage; reports from native speakers are especially valuable, and maintainers track them with the `translation` label. If you know the fix, propose it directly as a pull request against that language's style guide (`instructions.md`) or glossary (`glossary.json`) under [`i18n/`](https://github.com/modelcontextprotocol/python-sdk/tree/main/i18n) — the correction then reaches every affected page the next time the translations are regenerated. Problems with the English text itself are fixed in the pages under `docs/`, like any other documentation change.
25+
Found a wrong term, an awkward sentence, or a translation that says something the English doesn't? [Open an issue](https://github.com/modelcontextprotocol/python-sdk/issues) with the language, the page and the passage; reports from native speakers are especially valuable. If you know the fix, propose it directly as a pull request against that language's style guide (`instructions.md`) or glossary (`glossary.json`) under [`i18n/`](https://github.com/modelcontextprotocol/python-sdk/tree/main/i18n) — the correction then reaches every affected page the next time the translations are regenerated. Problems with the English text itself are fixed in the pages under `docs/`, like any other documentation change.

‎i18n/README.md‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,17 @@ The English pages under `docs/` are the source. This directory holds what steers
44

55
- `languages.yml` — the registry: one entry per translated site (served at `/<code>/`), the model id, and the nav pages that stay in English.
66
- `general-prompt.md` — translation rules shared by every language. `notices.md` — English source of the three notes staged onto the pages of a translated site.
7-
- `<code>/instructions.md` (register, voice, humour, typography, terminology) and `<code>/glossary.json` (`keep`: terms that stay in English; `terms`: required renderings, each with an optional `note` and banned `avoid` renderings, which are checked) — human-authored, sent with every request.
8-
- `<code>/pages/**` and `<code>/notices.md` — **generated**, never edited by hand: the next run overwrites them. A correction goes into that language's `instructions.md` or `glossary.json` (or into the English page), and the affected pages are then re-run.
7+
- `<code>/instructions.md` (register, voice, typography, terminology) and `<code>/glossary.json` (`keep`: terms that stay in English; `terms`: required renderings, each with an optional `note` and banned `avoid` renderings, which are checked) — human-authored, sent with every request.
8+
- `<code>/pages/**` and `<code>/notices.md` — **generated**, never edited by hand: a correction goes into that language's `instructions.md` or `glossary.json` (or the English page), and the affected pages are re-run.
99

1010
## The tool
1111

1212
```text
1313
uv run --frozen python scripts/docs/translations.py status [--lang CODE]
14-
uv run --frozen --group translate python scripts/docs/translations.py translate --lang CODE
15-
[--pages PATH ... | --grep REGEX] [--limit N] [--dry-run]
14+
uv run --frozen --group translate python scripts/docs/translations.py translate --lang CODE [--pages PATH ...]
1615
uv run --frozen python scripts/docs/translations.py stage --lang CODE
1716
```
1817

19-
`status` is offline: per language it lists missing, outdated (with the sections that changed), current and removable pages (translations whose English page is gone — `git rm` them), and pages the build will serve in English. `translate` calls the Claude API (`ANTHROPIC_API_KEY` in the environment) for missing and outdated pages, at most `--limit` (default 15) per run; `--pages` re-translates exactly the named pages from scratch (English only, no previous translation shown), `--grep` selects current pages whose English matches and reopens only the matching sections, and `--dry-run` prints the assembled prompts without calling anything. The model is the registry's, or `DOCS_TRANSLATE_MODEL` from the environment to trial another one for a run without editing the registry. `stage` assembles the tree a language site is built from; `scripts/docs/build.sh` runs it for every language.
18+
`status` is offline: per language it lists missing, outdated (with the sections that changed), current and removable pages (translations whose English page is gone — `git rm` them). `translate` calls the Claude API (`ANTHROPIC_API_KEY` in the environment; the registry's model, or `DOCS_TRANSLATE_MODEL` to trial another) for the missing and outdated pages, retranslating only the English sections that changed and keeping the rest byte for byte; `--pages` instead re-translates exactly the named pages from scratch, which is also how a glossary or instructions change reaches existing pages (each generated page records the English section hashes it reflects, so editing those inputs invalidates nothing). `stage` assembles the tree a language site is built from; `scripts/docs/build.sh` runs it for every language. Commit the generated pages in an ordinary pull request.
2019

21-
A page is outdated only when an English section it was translated from has changed; each generated page records the section hashes it reflects (plus a fingerprint of its prompt inputs, for information) in front matter that the build strips. Editing a glossary or instructions file therefore invalidates nothing: apply such a change to existing pages with `translate --grep`, which revises only the matching sections and keeps the rest byte-for-byte, or with `--pages` for a fresh translation of whole pages.
22-
23-
## Adding a language
24-
25-
Add an entry to `languages.yml`, write `<code>/instructions.md` (the six sections the pt-BR file has) and `<code>/glossary.json`, then dispatch the `.github/workflows/translate.yml` workflow for that code: it translates, builds the site strictly, and opens a draft pull request on branch `translate/<code>` with the generated pages, requesting the reviewers named in the registry. Each dispatch starts from `main`, so either pass a `limit` at least the page count `status` reports to fill a language in one run, or merge each refresh pull request before dispatching the next (a second run before the merge redoes the same pages). The workflow needs an `ANTHROPIC_API_KEY` repository secret, and the repository needs a `translation` label, which the issue form and the workflow's pull requests carry.
20+
To add a language, add an entry to `languages.yml`, write `<code>/instructions.md` (the sections the pt-BR file has) and `<code>/glossary.json`, then run `translate --lang <code>`.

‎i18n/ja/pages/translations.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
translation:
3-
sections: [f671b445b16e4f99, 620a3c9c5941ad66, 004b3ee918529d8c, c6e2debf1da06eb7, 16dcce4db41f5f65]
4-
inputs: 8113dbdcdf8cc017
3+
sections: [f671b445b16e4f99, 620a3c9c5941ad66, 004b3ee918529d8c, c6e2debf1da06eb7, 81d412ed5f399f94]
54
tool: 1
65
---
76
# 翻訳について {#translations}
@@ -28,4 +27,4 @@ API リファレンスは翻訳されません。翻訳版のサイトからは
2827

2928
## 翻訳の問題を報告する {#reporting-a-translation-problem}
3029

31-
誤った用語、ぎこちない文、英語版にない内容が書かれた翻訳を見つけた場合は、言語、ページ、該当箇所を添えて[翻訳の issue を作成](https://github.com/modelcontextprotocol/python-sdk/issues/new?template=translation.yaml)してください。ネイティブスピーカーからの報告は特に貴重で、メンテナーは `translation` ラベルを付けて追跡します。修正方法がわかっている場合は、[`i18n/`](https://github.com/modelcontextprotocol/python-sdk/tree/main/i18n) 配下にあるその言語のスタイルガイド(`instructions.md`)または用語集(`glossary.json`)へのプルリクエストとして直接提案してください。次に翻訳を再生成したときに、影響を受けるすべてのページに修正が反映されます。英語のテキスト自体の問題は、ほかのドキュメントの変更と同様に、`docs/` 配下のページで修正します。
30+
誤った用語、ぎこちない文、英語版にない内容が書かれた翻訳を見つけた場合は、言語、ページ、該当箇所を添えて [issue を作成](https://github.com/modelcontextprotocol/python-sdk/issues)してください。ネイティブスピーカーからの報告は特に貴重です。修正方法がわかっている場合は、[`i18n/`](https://github.com/modelcontextprotocol/python-sdk/tree/main/i18n) 配下にあるその言語のスタイルガイド(`instructions.md`)または用語集(`glossary.json`)へのプルリクエストとして直接提案してください。次に翻訳を再生成したときに、影響を受けるすべてのページに修正が反映されます。英語のテキスト自体の問題は、ほかのドキュメントの変更と同様に、`docs/` 配下のページで修正します。

0 commit comments

Comments
 (0)