Skip to content

Languages

One pair of keys in pages.config.js, for either kind of site:

defaultLocale: 'en',
locales: { en: 'English', ru: 'Русский' }, // or just ['en', 'ru']

Without them the site is single-language and nothing changes. With them, the default language lives at / and every other one under /<code>/; all pages are static — no browser-language detection, no redirects, no client script. Every page carries hreflang links to its existing translations plus x-default; the sitemap carries the same alternates. The language switcher lists the configured languages and takes the reader to the same page if the translation exists, otherwise to that language’s front page.

  • Landing page: a translation is a sibling file — articles/pricing/index.en.mdx and articles/pricing/index.ru.mdx. navigation and footerLines may be maps by language.
  • Knowledge base: a translation is a mirror folder named by the code — ru/Guide/Getting started.md/ru/guide/getting-started; ru/README.md is the Russian front page. An untranslated page shows the default-language text with a notice; the interface (search, “on this page”, previous/next) is translated by Starlight.

The Dockerfile and CI do not change: the language folder or files travel with the rest of the content.