Internationalization

|
|

DocsLit supports a lightweight locale layout without a full CMS.

Directory convention

  • Default locale content: docs/
  • Additional locales: docs.fr/, docs.ja/, … mirroring page IDs

Config

{ "i18n": { "defaultLocale": "en", "locales": ["en", "fr", "ja"], "labels": { "en": "English", "fr": "Français", "ja": "日本語" } }, "sidebar.fr": [ { "group": "Démarrage", "pages": ["getting-started/introduction"] } ] }

Non-default locales build under /{locale}/… (after basePath if set). The nav includes a locale switcher, and pages emit hreflang tags when url is configured.

hreflang tags

A page gets alternate-language tags only for locales that have it translated, plus the default locale and x-default. A page with no translations gets none. An untranslated fallback page inside a locale folder gets none either, because its canonical URL points at the default-language page.

Search and agent files

Each language is a self-contained site, so search works in every language. Each non-default language has its own search-index.json, llms.txt, llms-full.txt and sitemap.md in its folder, such as /fr/llms.txt. The default language keeps its files at the root. Agents that read the French site see only French pages and links. See How agents read your site.