Translation guide
The site is internationalisation-ready but currently ships English only. This page defines how a locale is added, so that the first translation does not have to invent the process.
Structure
Docusaurus keeps translated content beside the source, not inside it:
- docs/English source — the only editable curriculum
- i18n/
- es/
- docusaurus-plugin-content-docs/mirrors docs/ exactly
- docusaurus-theme-classic/navbar and footer strings
- code.jsonUI strings from React components
Adding a locale
Open an issue first
A locale needs at least two committed translators. A half-translated locale is worse than none: readers hit English pages with no warning and lose trust in the navigation.
Register the locale
Add it to
i18n.localesandi18n.localeConfigsindocusaurus.config.ts, includingdirectionfor right-to-left languages.Generate the scaffolding
pnpm write-translations --locale esThis produces
code.jsonand the theme translation files, pre-filled with the English strings.Copy the documents
mkdir -p i18n/es/docusaurus-plugin-content-docs/currentcp -r docs/* i18n/es/docusaurus-plugin-content-docs/current/Directory and file names stay identical to the English source. Only the prose is translated.
Build and check
pnpm build && pnpm serve
What must not be translated
Translating any of these breaks the site or, worse, breaks the reader's commands:
- Git commands, flags, output and error messages. A reader whose terminal is in English must be able to match your text to their screen. Translate the explanation, never the sample.
- Filenames, directory names and document
idvalues. These are the routing keys; translating one detaches the page from its English counterpart. - Code identifiers, configuration keys and branch names.
- Component names and their props.
<Checkpoint verify="...">stays as-is; the strings passed to it are translated. - Anchor ids pinned with
{#explicit-anchor}.
Frontmatter in translations
Translate title, sidebar_label, description and keywords.
Keep id, module, level, duration, status, tags and prerequisites
identical to the source. maintainers becomes the translators for that locale —
they are who should be asked about that file.
Keeping translations in sync
English is the source of truth and moves first. When an English document changes:
- The
i18n-driftworkflow opens an issue against each locale whose copy is now behind. - Until it is updated, the translated page keeps serving — a slightly stale translation is better than a missing page.
last_reviewedin the translated file records when the translation was last checked against the source, not when the source was verified.
Never let a translated document's last_reviewed exceed its source's.