TanStack i18n

TanStack i18n

Manage locale routing for TanStack Start and TanStack Router. Implement redirects, URL prefixes, and persist adapters with any translation library.

TanStack i18n handles locale routing for TanStack Start and Router. Use it for URL segments, first-visit redirects, and persisting or inferring locale — then pair it with your own translation library for strings.

What it handles

  • Locale segments in URLs — prefix always, hide for default, or custom paths per language
  • First-visit redirects and optional detect mode (banner UX without redirect)
  • Persist adapters (cookie, server function) and infer adapters (Accept-Language)
  • TanStack Start server entry — pass, redirect, sync cookie, detect
  • Router URL helpers and createLocaleProvider / setLocale for language switching

What it does not do

It does not ship message catalogs, t() helpers, or formatting. Bring your own translation library for strings.

Edit on GitHub