Skip to content

Internationalization

PreviousNext

Arabic first, English second — no i18n library.

Every page lives under /ar or /en. Arabic is the default and renders right-to-left.

Locale routing

src/proxy.ts redirects any path without a locale to the visitor's language (cookie first, then Arabic). The root layout sets lang and dir on <html>.

Dictionaries

UI text lives in JSON dictionaries, one file per namespace and language:

src/components/internationalization/dictionaries/
  ar/common.json, ar/docs.json, …
  en/common.json, en/docs.json, …

Read them on the server:

const { common, docs } = await getDictionary(lang)

Content language

Database content is written once, in one language. When a row's lang differs from the page locale, the UI marks it with the right lang and dir so it reads correctly.

RTL rules

  • Use logical utilities: ms-, me-, ps-, pe-, text-start, border-s.
  • Flip directional icons with rtl:rotate-180.
  • Code blocks always read left-to-right, even on an Arabic page.

Documentation

The docs have one folder per language — content/docs-en and content/docs-ar — each with its own meta.json. See Documentation.