Skip to main content

Use localization when you want readers to switch languages without leaving the same docs project.

Keep the default language at the root. Add one folder for each translated language.

Project Structure

docs
docs.json
index.mdx
getting-started.mdx
cli.mdx
concepts.mdx
fr
index.mdx
getting-started.mdx
cli.mdx
concepts.mdx
jp
index.mdx
getting-started.mdx
cli.mdx
concepts.mdx
nl
index.mdx
getting-started.mdx
cli.mdx
concepts.mdx

Use the root pages for your default language. Mirror the same page names in each locale folder.

Enable The Language Switcher

Add languages under navigation:

{
"navigation": {
"languages": {
"default": "en",
"items": ["en", "fr", "nl", "jp"]
},
"tabs": [
{
"id": "docs",
"label": {
"en": "Docs",
"fr": "Documentation",
"nl": "Documentatie",
"jp": "ドキγƒ₯γƒ‘γƒ³γƒˆ"
},
"content": ["index", "getting-started", "cli"]
}
]
}
}

Translate Navigation Labels

Translate every label and title that appears in navigation.

{
"title": {
"en": "Getting Started",
"fr": "Bien demarrer",
"nl": "Aan de slag",
"jp": "γ―γ˜γ‚γ«"
}
}

Show Pages Only In Some Languages

Use the languages field when a page or group should only appear in some languages.

{
"page": "enterprise-rollout",
"title": {
"en": "Enterprise Rollout",
"fr": "Deploiement entreprise"
},
"languages": ["en", "fr"]
}

Writing Tips

  • Keep page names the same across languages.

  • Translate navigation labels and page titles, not just body text.

  • Start with your most important pages.

  • Use code groups for programming languages and locale folders for human languages.

If only a few pages are translated, keep the language list small. It is better to support a few pages well than many pages halfway.

A Good Rollout Plan

  1. Publish the full docs set in English.

  2. Translate the homepage, CLI guide, and getting-started path into one additional language.

  3. Add translated navigation labels.

  4. Translate deeper guides after you know which pages people use most.

Next Pages