Thank you for your interest in translating the Mezo docs! This guide explains how internationalization (i18n) works in this project and how you can contribute translations.
This site is built with Astro Starlight, which has built-in i18n support. Key concepts:
- English is the root locale. English source files live directly in
src/content/docs/with no language prefix. - Other languages use subdirectories. Translated files go in
src/content/docs/<lang>/, mirroring the English file structure. For example, the Spanish translation ofsrc/content/docs/docs/users/musd.mdxlives atsrc/content/docs/es/docs/users/musd.mdx. - Two config files register each locale:
astro.config.mjs(Starlight) andlunaria.config.json(translation tracking dashboard).
-
astro.config.mjs— add an entry to thelocalesobject inside the Starlight config:locales: { root: { label: 'English', lang: 'en' }, es: { label: 'Español', lang: 'es' }, fr: { label: 'Français', lang: 'fr' }, // Add your language here },
-
lunaria.config.json— add an entry to thelocalesarray:{ "label": "Français", "lang": "fr" } -
Create the content directory at
src/content/docs/<lang>/(e.g.,src/content/docs/fr/).
- Find the English source file you want to translate (e.g.,
src/content/docs/docs/users/musd.mdx). - Copy it to the corresponding path under your language directory (e.g.,
src/content/docs/fr/docs/users/musd.mdx). - Translate the content, keeping the frontmatter structure intact. Update the
titleanddescriptionfields but leaveslugand other technical fields unchanged. - Preserve all links, images, and component imports as-is — only translate the human-readable text.
src/content/docs/
├── docs/ # English (root locale)
│ ├── users/
│ │ ├── musd.mdx
│ │ └── ...
│ └── developers/
│ └── ...
├── es/ # Spanish
│ └── docs/
│ └── users/
│ └── musd.mdx
└── fr/ # French
└── docs/
└── users/
└── musd.mdx
Run the dev server to preview your translations:
npm run devTranslated pages are available at http://localhost:4321/docs/<lang>/... (e.g., /docs/fr/docs/users/musd).
The Lunaria dashboard tracks translation progress across all locales. It automatically detects which pages have been translated and which are outdated based on git history.
After your translation is merged, the dashboard updates on the next build.