TanStack i18n
Reference

Exports and peers

Verify TanStack i18n package entry points and subpath exports. Inspect required and optional peer dependencies for React and Solid.

@Wadiou/tanstack-i18n ships as a core entry plus framework subpaths. Install the core package first, then add subpaths for the stack you actually use.

Subpath exports

SubpathPurposeGuide
@Wadiou/tanstack-i18ndefineLocaleConfig, createLocaleRuntime, and core constants/typesConfiguration, Locale runtime
@Wadiou/tanstack-i18n/adaptersAdapter factories (cookie, localStorage, acceptLanguage, serverFn) and their optionsAdapters
@Wadiou/tanstack-i18n/react-routercreateNavigation, createToLocalizedRoute for ReactTanStack Router
@Wadiou/tanstack-i18n/solid-routercreateNavigation, createToLocalizedRoute for SolidTanStack Router
@Wadiou/tanstack-i18n/reactcreateLocaleProvider, useLocaleContextChange locale, use-intl
@Wadiou/tanstack-i18n/solidSolid createLocaleProviderChange locale
@Wadiou/tanstack-i18n/react-startcreateServerEntry and React helpersTanStack Start
@Wadiou/tanstack-i18n/solid-startcreateServerEntry and Solid helpersTanStack Start

The core entry covers locale config and runtime. Adapters are loaded from the /adapters subpath. Other subpaths add framework bindings — you do not need every subpath on day one.

Peer dependencies

Peers are optional — install only what your stack uses:

EntryPeers
@Wadiou/tanstack-i18n
@Wadiou/tanstack-i18n/reactreact
@Wadiou/tanstack-i18n/solidsolid-js
@Wadiou/tanstack-i18n/react-router@tanstack/react-router
@Wadiou/tanstack-i18n/solid-router@tanstack/solid-router
@Wadiou/tanstack-i18n/react-start@tanstack/react-start
@Wadiou/tanstack-i18n/solid-start@tanstack/solid-start

Install only what you need

  • React + TanStack Start and Router — core, @Wadiou/tanstack-i18n/react, @Wadiou/tanstack-i18n/react-router, and @Wadiou/tanstack-i18n/react-start when you wire routing and the server entry.
  • Solid — core, @Wadiou/tanstack-i18n/solid, @Wadiou/tanstack-i18n/solid-router, and @Wadiou/tanstack-i18n/solid-start for the same roles.

See Install for package manager commands and a first config snippet.

Default constants

Exported from the core entry for docs and custom adapters:

ConstantValueUsed when
DEFAULT_URL_PREFIX"as-needed"url.prefix omitted
DEFAULT_COOKIE_NAME"LOCALE"cookie() with no name
DEFAULT_DETECTED_LOCALE_HEADER"X-Locale-Detected"firstVisit.detectedLocaleHeader omitted

Full normalization table: Configuration — Defaults at a glance.

For runtime guarantees (redirects, getLocale order), see Behavior contract.

Type details live in package JSDoc and .d.ts files — there are no generated TypeDoc pages in v1.

Edit on GitHub