Skip to main content

Localization and Routing

This docs site uses Docusaurus i18n routing.

Expected URL Behavior

  • Default locale (en): /docs/...
  • Non-default locales (ar, fr, de, ...): /<locale>/docs/...

This is the correct Docusaurus behavior.

Why Language Switching Can Fail on localhost

docusaurus start serves one locale at a time. If you run a single-locale dev server (for example --locale ar), selecting another language in the dropdown may not work locally because that locale is not served by that dev process.

Default Localhost Command (All Locales)

Use the default docs command. It builds and serves all locales from one local site:

pnpm --dir apps/public/docs-ui dev

Equivalent commands:

pnpm --dir apps/public/docs-ui start
pnpm --dir apps/public/docs-ui preview:i18n

Then open http://localhost:8000 and switch languages from the dropdown.

Single-Locale Dev Commands

Use these for faster content editing of one locale:

pnpm --dir apps/public/docs-ui dev:en
pnpm --dir apps/public/docs-ui dev:ar

Operational Recommendation

  • Use dev or start for multi-locale routing and locale-switch validation.
  • Use dev:* for faster single-locale authoring.