Adds translated docs for Spanish, Korean, Polish, Portuguese, Ukrainian, and Chinese Covers install, quickstart, themes, troubleshooting, tunnels, and reverse proxy guides Updates docs workflow, sidebar, and contributor documentation
5.4 KiB
Docs Authoring Guide
This package is docs content source-of-truth for OpenChamber.
Add a new docs page
-
Create a new file in
packages/docs/content/docs/.- Example:
packages/docs/content/docs/remote-access.mdx
- Example:
-
Add frontmatter at top:
--- title: Remote Access description: Access OpenChamber from outside your local network. --- -
Use route-safe naming:
foo.mdx->/foo/folder/index.mdx->/folder/folder/bar.mdx->/folder/bar/
-
Add translations for the page — see Localization. Translations are optional per page (a missing translation falls back to English), but ship them together with the page when you can.
-
If the page is linked from the sidebar, add its localized labels too — see Translate the sidebar.
-
Run validation:
bun run docs:validate
Add a new sidebar section
Edit packages/docs/sidebar.config.json.
Example:
{
"label": "Advanced",
"items": [{ "label": "Remote Access", "link": "/remote-access/" }]
}
Rules:
- use trailing slash in links (
/page/) - every sidebar link must map to an existing MDX file
- keep section labels short and task-oriented
Localization
The docs are translated into the same languages the OpenChamber app ships in.
English is the source of truth and lives at the root of content/docs/. Every
other language mirrors the English files under a locale folder.
Supported locales
| Language | Content folder | Sidebar translations key |
|---|---|---|
| English | (root, no folder) | en |
| Ukrainian | uk/ |
uk |
| Chinese (Simplified) | zh-cn/ |
zh-CN |
| Spanish | es/ |
es |
| Brazilian Portuguese | pt-br/ |
pt-BR |
| Korean | ko/ |
ko |
| Polish | pl/ |
pl |
Important
The content folder uses the lowercase locale key (
zh-cn,pt-br); the sidebartranslationskey uses the BCP-47 language tag (zh-CN,pt-BR). They look similar but are not interchangeable — Starlight resolves them with different rules. Everything else (uk,es,ko,pl,en) is identical in both columns.
This locale set is mirrored in the website at
openchamber-website/apps/docs/astro.config.mjs (locales). If a language is
added or removed, update both places.
Translate a page
Mirror the English file under each locale folder, keeping the exact same filename and path. Starlight matches a translation to its English page by path.
content/docs/
install.mdx # English (source of truth)
uk/install.mdx # Ukrainian
zh-cn/install.mdx # Chinese (Simplified)
es/install.mdx # Spanish
pt-br/install.mdx # Brazilian Portuguese
ko/install.mdx # Korean
pl/install.mdx # Polish
guides/tunnels.mdx # nested English page
uk/guides/tunnels.mdx # its Ukrainian translation
Each translated file needs its own translated frontmatter (title and
description are required by validation):
---
title: Встановлення
description: Встановіть OpenChamber для десктопа, вебу або VS Code.
---
You do not have to translate every page at once. A page that is missing in a locale automatically falls back to the English version, so translations can land incrementally.
Translate the sidebar
Do not create separate sidebar entries per language and do not add a
locale prefix to link — Starlight prefixes the active locale automatically.
Instead, add a translations map (keyed by the BCP-47 tag from the table above)
to each section and item in sidebar.config.json:
{
"label": "Start here",
"translations": {
"uk": "Почніть тут",
"zh-CN": "从这里开始",
"es": "Empieza aquí",
"pt-BR": "Comece aqui",
"ko": "여기서 시작",
"pl": "Zacznij tutaj"
},
"items": [
{
"label": "Install",
"link": "/install/",
"translations": {
"uk": "Встановлення",
"zh-CN": "安装",
"es": "Instalación",
"pt-BR": "Instalação",
"ko": "설치",
"pl": "Instalacja"
}
}
]
}
A label with no translation for the active locale falls back to the English
label.
What not to translate
- brand and product nouns: OpenChamber, OpenCode, VS Code, PWA, GitHub, Discord, macOS, SSH
- code blocks, shell commands, file paths, flags, and config keys
- the page filename and the sidebar
link(these stay identical across locales)
Validate
bun run docs:validate walks every .mdx under content/docs/ — including
translations — and fails if any page is missing title or description
frontmatter, or if a sidebar link does not resolve to an English page. Run it
after adding or translating pages.
Sync into openchamber-website
openchamber-website renders/deploys docs via Starlight in apps/docs.
After docs content updates here:
- copy
packages/docs/content/docs/*->openchamber-website/apps/docs/src/content/docs/*(this is recursive, so locale folders likeuk/andzh-cn/carry over with no extra steps) - map
packages/docs/sidebar.config.jsonintoopenchamber-website/apps/docs/astro.config.mjssidebar (thetranslationsmaps carry over as-is) - run docs checks/build in website repo
Automation support exists in .github/workflows/docs-source.yml (release/manual packaging of docs source artifact).