You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6107a94
Browse filesBrowse the repository at this point in the historyBrowse files
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.
Copy file name to clipboardExpand all lines: docs/translations.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,4 +22,4 @@ Translated pages are machine-generated by a tool in this repository from the Eng
22
22
23
23
## Reporting a translation problem
24
24
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.
Copy file name to clipboardExpand all lines: i18n/README.md
+5-10Lines changed: 5 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,22 +4,17 @@ The English pages under `docs/` are the source. This directory holds what steers
4
4
5
5
-`languages.yml` — the registry: one entry per translated site (served at `/<code>/`), the model id, and the nav pages that stay in English.
6
6
-`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.
9
9
10
10
## The tool
11
11
12
12
```text
13
13
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
uv run --frozen python scripts/docs/translations.py stage --lang CODE
17
16
```
18
17
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.
20
19
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>`.
0 commit comments