← Back to Docs
Recipe

i18n Patterns

Production-tested strategies for shipping Meridian in multiple languages without losing velocity.

Key-based extraction

Every user-facing string lives behind a dot-notated key. The loader resolves locale at request time via the Accept-Language header.

{
  "hero.cta": "Start building",
  "hero.cta": "Comenzar",
  "pricing.monthly": "/mo"
}

Namespaced bundles

Split translations by route segment. dashboard.* keys never ship to the landing page bundle.

Plural & interpolation

Use ICU MessageFormat for plurals and variable substitution. The runtime compiles templates once and caches the AST.

{count, plural, =0 {No licenses}
  one {# license} other {# licenses}}

Fallback chain

Meridian walks fr-CA → fr → en. If a key is missing in Canadian French, it falls back to metropolitan French, then English. No blank screens.

RTL support

Set dir="rtl" on the root element when the active locale is Arabic or Hebrew. Tailwind logical properties handle the rest.