Introducing a new way to review your PRs.

Read the announcement

generaltranslation / gt

Full-stack localization for every framework

View on GitHub

22 documents · Updated Nov 23, 2026

docs / application-framework-integrations

Application framework integrations

The framework integrations adapt the shared localization runtime to the state and request models of each supported application framework. They expose one translation experience while defining where locale conditions live, how catalogs reach rendering code, and which setup must run before an application handles work.

Integration model

Each adapter connects four boundaries: framework setup, locale and request conditions, translation catalog access, and rendering APIs. The shared React core supplies the common provider and lookup model. Each adapter chooses storage and life-cycle rules that fit its host runtime.

BoundaryPurposeTypical adapter responsibility
SetupEstablish configuration and runtime servicesInitialize locale data and the translation cache before use
ProviderMake conditions and catalogs available to UI codeBind a framework provider to the shared rendering context
CacheLoad and reuse translations and dictionariesUse server loaders, browser data, or an application callback
RequestSelect locale, region, and translation enablementRead request data or client state and keep it in the right scope

The main paths are React integration, Next.js integration, and alternative framework integrations. React is the shared UI base. Next.js adds server, route, build, and client-navigation boundaries. Vue, React Native, and TanStack Start use the same localization concepts with different application life cycles.

Runtime boundaries

The runtime separates data that can be shared from data that must follow a request or application instance. Configuration and cache services are initialized for the runtime. Locale conditions are then read through a provider or request scope before translation content is rendered.

Browser and native state

Browser and native adapters keep locale state writable so a user can change it. Browser state uses cookies and reloads or refreshes the document through the adapter's reload boundary. React Native state uses native storage on native platforms and keeps a stable translation store inside the provider. Both providers send updated conditions back through the shared provider so the component tree can render again. Configured locale aliases remain the user-facing values used by selectors, cookies, and cache lookups.

References: packages/…/BrowserGTProvider.tsx• L15-101 packages/…/BrowserConditionStore.ts• L41-89 packages/…/createBrowserConditionStore.ts• L34-67 packages/…/NativeGTProvider.tsx• L19-41 packages/…/NativeConditionStore.ts• L30-95

Server request state

Server adapters keep locale conditions isolated from other requests. The Node runtime uses an async request scope around application entry points. Next.js and TanStack Start establish an equivalent scope through their server request boundaries. Server providers read that state and pass resolved catalogs into client-capable rendering. This prevents one request's locale from becoming another request's locale.

Server-rendered apps use the server-provided locale and condition values as the rendered state. A condition setter writes the selected value for later request handling and asks the host to refresh or reload. Provider-free SPA apps keep their cookie-backed behavior instead of using this server snapshot rule.

Next.js also keeps the public locale path and the internal route path aligned before rendering. A configured locale spelling is the identity used by routes and client state. A canonical locale code describes the language identity behind that spelling. Several configured spellings can therefore share one canonical code without collapsing their public routes.

References: packages/…/withGT.ts• L1-8 packages/…/AsyncConditionStore.ts• L24-85 packages/…/AsyncConditionStore.test.ts• L13-25 packages/…/createNextMiddleware.ts• L98-117 packages/…/createMiddlewareRouting.ts• L53-72 packages/…/gtMiddleware.ts• L7-16 packages/…/requestConditions.localeAliases.test.ts• L20-77

Provider and cache flow

The provider is the handoff point between an adapter and shared UI translation features. The adapter resolves active conditions, obtains catalogs through its cache boundary, and gives both to the shared provider so components and hooks use one consistent view.

This diagram shows the common flow from application setup to localized rendering.

flowchart LR
    A[Application setup] --> B[Locale and request conditions]
    B --> C[Provider boundary]
    C --> D[Translation and dictionary cache]
    D --> E[Shared UI runtime]
    E --> F[Localized components and lookups]
    F --> G[Locale change]
    G --> B

The shared provider receives translation snapshots and optional dictionary data. React and Next.js usually obtain data before rendering. Vue and React Native can load a catalog through their provider life cycle. Next.js resolves the server locale and cache data first, then sends a snapshot to its client boundary so server-rendered content and browser state start from the same conditions. Next.js server formatting components such as RelativeTime also read the active request conditions before delegating to the shared React renderer, so formatted values use the same locale as surrounding content and can remain inside translated content. The shared variable identity for this formatted content stays aligned with extraction and runtime lookup.

React lookup hooks keep a stable function identity across renders. In development, runtime responses refresh direct, memoized, and effect-derived lookups, including lookups made by children rendered after React yields; memoized dictionary objects receive the new values as well. This keeps development hot reload aligned with ordinary rendering and React's concurrent scheduling.

The TanStack Start client provider wraps the shared React provider and supplies the client reload hook created during browser setup. This keeps locale changes inside the application's route flow when locale routing is enabled, while still allowing an explicit reload callback.

References: packages/…/GTProvider.tsx• L9-42 packages/…/client-boundary.tsx• L41-113 packages/…/RelativeTime.tsx• L1-16 packages/…/index.types.ts• L169-189 packages/…/BrowserGTProvider.tsx• L15-92 packages/…/GTProviderProps.ts• L10-21 packages/…/BrowserGTProvider.test.tsx• L100-132 packages/…/clientHooks.test.tsx• L91-125 packages/…/clientHooks.test.tsx• L144-191 packages/…/clientHooks.test.tsx• L217-283 packages/…/GTProvider.client.tsx• L1-10 packages/…/initGT.test.ts• L117-135

Cache ownership

Cache ownership follows the host runtime. React uses a cache service supplied during setup. Next.js keeps server dictionaries and translation loaders on the server while its browser side consumes server-provided data and uses a client-safe cache. Browser React can persist runtime translations across cache recreation. Vue keeps catalogs in its plugin instance. The cache life must match state life: a server request needs isolation, while a browser or Vue application can reuse its loaded catalogs.

Next.js initialization keeps an existing server cache when setup runs again. Its server path can also enable development hot reload from runtime credentials. In development, the configured GT_API_KEY may be exposed to client code for that hot-reload path. Production builds do not expose a development key. Its client path uses the React cache rather than the server-only Next.js cache.

References: packages/…/ReactI18nCache.ts• L1-5 packages/…/BrowserI18nCache.ts• L22-78 packages/…/BrowserI18nCache.localeAliases.test.ts• L12-65 packages/…/GTProvider.tsx• L9-29 packages/…/initGT.test.ts• L46-135 packages/…/runtimeCredentials.ts• L1-19 packages/…/state.ts• L81-140

Catalog handoff

Server-aware adapters complete the cache read before they cross into client rendering. Next.js loads the active locale's translations and dictionaries, then passes snapshots and server conditions to its client provider. React's server and browser providers use the same shared context shape, but each creates the condition store that belongs to its side of the boundary.

The browser provider treats a fresh server snapshot as authoritative for the current render. A rejected locale change can return the old server locale, so the browser keeps that server value while preserving local UI state and carrying the requested value into the next navigation.

References: packages/…/GTProvider.tsx• L18-40 packages/…/client-boundary.tsx• L41-113 packages/…/BrowserGTProvider.tsx• L15-37 packages/…/GTProviderProps.ts• L10-21 packages/…/BrowserGTProvider.test.tsx• L100-132 packages/…/ServerGTProvider.localeAliases.test.tsx• L25-60

Setup boundaries

Setup is split by runtime so browser-only state does not enter server code and server request state does not leak into a long-lived client process. A framework entry point selects the correct setup path and then exposes its framework-native API.

RuntimeSetup boundaryResult
React server-renderedinitializeGT from the server entry pointShared configuration and React cache are ready for server rendering
React browser SPAinitializeGTSPA from the browser entry pointBrowser cache, writable conditions, and initial translations are ready
Next.jsServer, client, RSC, middleware, and worker-aware entry pointsThe package selects APIs and cache rules for each Next.js execution mode
VuecreateGT or initializeGTSPAA plugin owns locale state and its catalog cache
React NativeinitializeGT and GTProviderNative conditions and asynchronous catalog loading are available to the app
TanStack StartServer or client initializeGT plus a framework providerRequest middleware or browser state supplies conditions and route-aware reloads to shared React APIs

Next.js setup carries non-secret runtime configuration to the relevant server and client boundaries. It selects whether the installed Next.js version supports a server component refresh after a locale change. The server initializer owns the Next.js cache, while the client initializer uses a browser-safe React cache. Development hot reload can pass the development runtime key to client code. Production builds omit that key. The Next.js package installs the compiler as a regular dependency and publishes its compiler asset, so the experimental Babel or SWC build path is available without a separate compiler install.

Compatibility boundaries

Each adapter also declares the host versions that it can support. These package contracts keep a framework from selecting an integration whose provider or runtime entry cannot run in the application.

AdapterHost contract
ReactReact and React DOM 18 or newer
Next.jsNext.js >=13.0.0, excluding 15.2.1 and 15.2.2, with React and React DOM >=16.8.0 and <20.0.0
VueVue 3.3 through the Vue 3 release line
React NativeReact 19 or newer with React Native 0.78 or newer
TanStack Start@tanstack/react-start 1.159 or newer with React and React DOM 16.8 or newer

These are peer contracts rather than a second localization policy. A host upgrade can change which runtime entry, server boundary, or client transition the adapter can safely use, so the package range and the integration behavior must remain aligned.

References: packages/…/package.json• L15-23 packages/…/package.json• L9-17 packages/…/package.json• L6-30 packages/…/package.json• L13-20 packages/…/package.json• L98-115 packages/…/package.json• L13-22 packages/…/config.test.ts• L90-99

Next.js configuration boundary

withGTConfig is the build boundary for a Next.js application. It combines GT settings with the user's Next.js configuration, makes safe runtime settings available to server and client code, and connects configured dictionaries, loaders, request functions, and compiler support to the build. It accepts both object and function forms of Next.js configuration, including functions that return a promise.

The function form preserves the user's phase and context resolution before applying the GT configuration. This lets GT compose with other Next.js configuration plugins instead of treating a configuration function as a plain object. The boundary also resolves the installed Next.js version in ESM configuration files, so next.config.mjs and other module-based config forms use the same version-aware setup.

The boundary keeps production credentials out of client configuration. It also checks that GT locale settings agree with Next.js internationalized routing and rejects missing loader files, conflicting settings, invalid service locales, and development credentials in production. When it compares a config file with Next.js locale settings, the effective GT locale set includes the GT default locale because GT always supports it. Duplicate values and order do not create a false mismatch. In development, the runtime key is intentionally available to client code only when hot reload is enabled. Production builds omit that key. The result is a single configuration contract for middleware, providers, request helpers, and build tools. The published package also carries the compiler asset needed by the Next.js build path.

withGTConfig also carries middleware routing options into the build configuration. createNextMiddleware options override those values at request time. In development, the middleware warns when its prefixDefaultLocale or enableSmartRouting values differ from the values that gt-next/link reads from withGTConfig, because links must make the same prefix choice as middleware.

The configuration also publishes whether the detected Next.js version supports the locale refresh path. This lets the client boundary choose a server component refresh when available and retain a document reload when it is not.

References: packages/…/config.ts• L105-149 packages/…/config.ts• L149-220 packages/…/config.ts• L249-359 packages/…/config.ts• L643-805 packages/…/withGTConfigProps.ts• L47-106 packages/…/runtimeCredentials.ts• L1-19 packages/…/nodeCompat.ts• L1-21 packages/…/createErrors.ts• L46-71 packages/…/createErrors.ts• L101-147 packages/…/config.test.ts• L90-194 packages/…/config.test.ts• L463-652 packages/…/config.test.ts• L1237-1287 packages/…/config.test.ts• L1446-1470 packages/…/packageExports.test.ts• L127-144 packages/…/package.json• L17-30

The React package exposes distinct server, browser, React Server Component, and worker runtime entry conditions. Unsupported calls fail at the wrong boundary instead of silently creating shared state. Next.js follows the same split and marks APIs that belong only to the Pages Router or only to server rendering. TanStack Start also keeps worker and browser exports separate. React Native preserves its native module as an explicit side-effect entry while exposing a web-safe package surface. Vue publishes separate CommonJS and ESM package entry points for Vue 3 consumers.

References: packages/…/index.server.ts• L7-45 packages/…/index.client.ts• L3-16 packages/…/index.rsc.ts• L1-30 packages/…/package.json• L72-134 packages/…/index.client.ts• L19-43 packages/…/index.rsc.ts• L1-19 packages/…/index.server.ts• L1-18 packages/…/client-boundary.tsx• L1-19 packages/…/package.json• L56-121 packages/…/package.json• L48-68 packages/…/package.json• L8-59 packages/…/package.json• L54-89 packages/…/package.json• L54-64 packages/…/packageExports.test.ts• L44-125

Request setup

Request setup must run before request-dependent localization APIs. A plain Node application selects a locale from request headers and wraps the handler with that locale. Next.js reads routing and request inputs through its condition store. TanStack Start uses global request middleware to create the active scope before server routes, server functions, or SSR code read locale state.

Next.js middleware configuration has one shared contract. Defaults enable locale routing and smart routing without a default-locale prefix. Values from withGTConfig override those defaults, while options passed directly to createNextMiddleware have the final precedence. Invalid configuration passed through the build environment is ignored after a diagnostic, so the explicit middleware options remain usable.

Next.js middleware detects locale candidates in this order: the path or a configured default-locale alias, an explicit reset choice, the locale cookie, the referrer locale, the browser language header when enabled, and the configured default. It returns a pass-through, rewrite, or redirect response. It also writes the selected locale to the response so later provider and client code use the same identity. With smart routing disabled and default-locale paths unprefixed, a returning visitor's ordinary unprefixed URL selects the default locale. A first document visit still uses browser language preferences, and an explicit default-locale prefix persists that choice through the redirect.

Next.js routing supports shared paths, locale-specific aliases, locale-specific route overrides, and locale availability rules. pathConfig maps a shared path to a public alias. routeOverrides selects a separate internal page path. localeRoutes limits which shared paths a locale can serve. Dynamic, catch-all, optional catch-all, encoded, base-path, and trailing-slash forms remain part of the same public-to-internal route contract.

Next.js links use the same public locale path rules before navigation. gt-next/link wraps Next.js Link, while useLocalizeHref supports navigation APIs such as router.push; server code can use getLocalizeHref or the server version of useLocalizeHref. Internal paths receive the current or requested locale when middleware would use a prefix. External URLs remain unchanged, and locale={false} leaves a path untouched. A pathRegex can leave selected unprefixed paths unchanged. A path that already contains a locale is still treated as an unlocalized input and produces a development warning. The warning does not change the href, but it identifies a link that can receive a doubled prefix.

Pages Router integrations can delegate active-locale resolution to Next.js internationalized routing. The client boundary keeps server-rendered content aligned with the browser path: it refreshes server components after a locale change when the installed Next.js version supports it, and otherwise reloads the page. It reloads the browser when adding or removing a default-locale path prefix requires navigation. The package selects these behaviors from the detected Next.js and React versions. TanStack Start's client provider applies the same route-aware handoff through its client setup before shared React code handles the change.

References: packages/…/getRequestLocale.ts• L8-39 packages/…/withGT.ts• L3-8 packages/…/localeValidation.ts• L19-46 packages/…/defaultMiddlewareConfig.ts• L3-35 packages/…/resolveMiddlewareConfig.ts• L8-41 packages/…/createMiddlewareRouting.ts• L28-193 packages/…/createNextMiddleware.ts• L23-79 packages/…/createNextMiddleware.ts• L94-168 packages/…/createNextMiddleware.ts• L170-407 packages/…/Link.tsx• L11-78 packages/…/localize-utils.ts• L21-91 packages/…/useLocalizeHref.ts• L5-45 packages/…/getLocalizeHref.ts• L6-55 packages/…/server.ts• L10-28 packages/…/client-boundary.tsx• L52-105 packages/…/getStableNextVersionInfo.ts• L84-128 packages/…/gtMiddleware.ts• L7-16 packages/…/initializeGT.client.ts• L16-40 packages/…/GTProvider.client.tsx• L1-10 packages/…/middleware.edge.test.ts• L94-216 packages/…/Link.test.tsx• L59-216 packages/…/pagesRouter.test.ts• L111-157

Framework choices

The supported adapters share translation features but differ in the boundary that starts and ends a localization context. Use the child page that matches the host application before changing provider, cache, request, or setup behavior. The React integration, Next.js integration, and alternative framework integrations pages describe those host-specific choices.

HostMain localization boundaryChild page
ReactProvider plus server or browser entry pointReact integration
Next.jsBuild configuration plus server, client, RSC, worker, request, locale-path routing, and localized-link supportNext.js integration
Vue 3Installed plugin with instance-scoped state and cacheAlternative framework integrations
React NativeNative storage, provider loading, and app life cycleAlternative framework integrations
TanStack StartRequest middleware plus server and client providersAlternative framework integrations
Other Node serverExplicit initialization, request locale selection, and async scopeAlternative framework integrations

The adapter choice affects more than the component import. It determines how the active locale is found, when catalogs are ready, how locale changes reach the UI, and which setup is safe for the execution environment. Locale aliases add one shared concern across adapters: route, cookie, selector, cache, and request code must use the configured spelling while translation services can use the mapped canonical code.

References: packages/…/parseLocale.test.ts• L17-75 packages/…/pagesRouter.test.ts• L111-157 packages/…/requestConditions.localeAliases.test.ts• L20-77 packages/…/parseLocale.test.ts• L106-175 packages/…/package.json• L1-20 packages/…/package.json• L1-15 packages/…/package.json• L1-23 packages/…/package.json• L1-22

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep server, browser, RSC, middleware, and worker exports aligned with the state each boundary can safely access.
  • If a provider input changes, check the matching condition store and the catalog snapshot handoff.
  • If cache life or loading changes, check whether the adapter still isolates server requests and reuses client catalogs as intended.
  • If locale selection changes, check request middleware, cookies or native storage, and the client transition path together.
  • If smart routing policy changes, check first-visit negotiation, returning-visitor cookies, explicit default-locale prefixes, and background requests together.
  • If a framework adds a setup step, check that its package entry point and child integration page describe the same ordering.
  • If a framework provider delegates to the shared React provider, check that its client setup supplies the correct reload and route handoff.
  • If the Next.js client boundary changes, check both route matching and the choice between refreshing server components and reloading the browser page.
  • If locale mappings or storage names change, check every adapter that reads or writes the related request or client state.
  • If a platform export changes, check that native side effects remain available on native targets and that web consumers do not load native modules.
  • If Next.js loader or dictionary aliases change, check that server-only resources remain out of browser bundles and still resolve in the supported bundlers.
  • If Next.js middleware path rules change, check aliases, route overrides, locale availability, dynamic and catch-all paths, encoded path segments, base paths, and trailing-slash preservation as one routing contract.
  • If Next.js version gates change, check the provider refresh behavior, compiler support, worker exports, and configuration fields together.
  • If the Next.js build asset, compiler dependency, or package export map changes, check that published compiler support and runtime-specific entry points remain available to their intended consumers.
  • If a package peer range changes, check that its runtime export conditions and the host-version behavior gates still describe the same supported applications.
  • If Next.js initialization changes, check that repeated setup keeps the intended cache instance and that client initialization still uses the client-safe cache.
  • If runtime credentials change, check the development hot-reload exposure, production omission, legacy environment fallback, and client configuration boundary together.
  • If a server formatting component changes its runtime marker or request-condition handoff, check that translated content, extraction, and locale formatting still use the same variable identity.
  • If React lookup hooks change, check stable hook identity and development response updates for direct, memoized, effect-derived, dictionary, and scheduler-delayed lookups.
  • If shared middleware options change, check withGTConfig, createNextMiddleware, and gt-next/link precedence together.
  • If localized-link behavior changes, check <Link>, useLocalizeHref, getLocalizeHref, default-locale prefix rules, external URLs, and prelocalized-path warnings together.
  • If the Next.js configuration wrapper changes, check object and function-form configs, including async configs, for preserved user settings before GT settings are applied.
  • If the Next.js config runtime changes, check that Node-only module loading and asset paths work in both CommonJS and ESM config execution.
  • If GT and Next.js locale comparison changes, check the effective locale sets, including the supported GT default locale, duplicate removal, and order-independent matching.

Important failure modes

TriggerConsequenceGuard
A server request reads locale state outside its async scopeDevelopment errors or an unsafe fallback locale in productionEnter the request through withGT, Next.js request setup, or gtMiddleware before localization calls
A browser-only initializer runs from a server entry pointBrowser state is created in the wrong runtime or the call failsUse the runtime-specific package entry point and setup function
A worker runtime resolves a browser entry instead of a server entrySSR can access browser globals or share locale state across requestsKeep worker export conditions ahead of the browser condition in React, Next.js, and TanStack Start package maps
A client provider receives no server or loaded catalogThe UI can render source content instead of the requested translationComplete the server cache read or provider load before relying on translated output
A React translation hook changes identity across rendersEffects and memoized values can rerun or lose the expected development update pathPreserve stable hook identities and verify direct and deferred lookups during development hot reload
TanStack Start uses its client provider before client initializationLocale changes can fall back to a full document reload instead of the configured locale routeRun client initialization before mounting the provider and preserve an explicit reload callback when one is required
A server snapshot and browser condition store use different locale identitiesHydration or a locale switch can show stale content or select the wrong routeResolve aliases to configured locale spellings before provider, cookie, and cache handoff
Smart routing treats a first document visit like a returning visitBrowser language selection can be replaced by the default locale or an unintended cookieKeep first-visit detection separate from returning-visitor preference and persist an explicit default choice only for the document redirect
Separate Vue plugins serve component and module-level lookupsLocale and catalog state split between two runtimesInstall the exact plugin returned by initializeGTSPA for SPA module-level translations
TanStack Start middleware is not globalServer routes and functions have no active request condition scopeRegister gtMiddleware as global request middleware
Next.js route locale state changes without the client boundary syncServer components can show the prior locale or the URL can keep the wrong default-locale formLet the client boundary compare the path with the selected locale and use refresh or reload as required
Next.js middleware maps a localized route to the wrong internal shapeA request can redirect in a loop, render the wrong page, or lose route parametersKeep shared-path matching, locale aliases, route overrides, availability rules, and rewrite targets aligned
Next.js middleware normalizes an encoded or malformed path incorrectlyA valid route can miss or a redirect can change the requested resourceNormalize path segments independently and preserve dynamic values, base paths, query strings, and slash style
A configured locale alias is collapsed to its canonical code in a route or cookieThe public URL, cache key, or selector no longer matches the configured application localeKeep configured spellings as runtime identities and use canonical codes only for locale resolution
withGTConfig exposes a production credential or a development key when hot reload is disabledA private key can reach a browser bundle or a disabled feature can receive unintended credentialsRead supported environment names at setup, expose a key only for development hot reload, and omit development keys from production output
React Native's native module is loaded by a web buildWeb rendering can fail during package importKeep the native module lookup guarded and preserve the platform checks
Next.js dictionary or loader aliases are not applied by the bundlerServer lookups can silently lack dictionaries or translationsKeep the server alias setup compatible with the supported webpack and Turbopack paths
The published Next.js package omits its compiler asset or compiler dependencyThe build-time translation path can fail even when runtime entry points resolvePreserve the package asset and regular compiler dependency and keep the release check that verifies them in full builds
An application uses a host version outside an adapter's peer rangeInstallation or build resolution can fail, or version-gated locale behavior can be wrongCheck the adapter's peer contract before changing the host framework version
Next.js setup replaces an existing cache during a second initializationA running request path can lose its cache state or use a different cache policyPreserve the first initialized Next.js cache and use the client-safe React cache on the client
Development credentials are serialized into client configuration in productionA private key can reach a browser bundle or production can accept a development keyUse GT_PROJECT_ID and GT_API_KEY for runtime setup, allow client exposure only for development hot reload, and omit development credentials from production
A Next.js formatting component uses a variable marker that differs from the extractor markerA translated component can fail at render time or use the wrong value shapeKeep the server component marker and the shared variable identity aligned with extraction and runtime lookup
createNextMiddleware and withGTConfig use different routing optionsLinks can create URLs that middleware redirects or normalizesSet shared routing options in withGTConfig and use middleware options only for intentional request-time overrides
A localized link receives a path that already has a locale prefixThe link can receive a doubled locale prefix and navigate to the wrong pathPass an unlocalized path or use locale={false}; treat the development warning as a routing defect
Middleware configuration in the build environment is malformedThe middleware falls back to defaults and may use a different routing policy than expectedConfigure middleware through withGTConfig or pass valid options directly to createNextMiddleware
A Next.js config function is treated as an objectUser config can be lost before the localization settings are appliedKeep function and async-function composition in withGTConfig and preserve the original phase context
The Next.js config runs without Node compatibility support in an ESM buildConfig loading or compiler asset resolution can fail before the application buildsKeep Node module loading and distribution paths behind the config-only compatibility boundary
GT and Next.js locale lists use different effective setsConfiguration emits a mismatch warning and the two routing systems can select different localesInclude the GT default locale in the comparison and keep locale values unique before comparing the sets

Key files

FileWhy to read it
packages/…/InternalGTProvider.tsxDefines the shared provider handoff between conditions, catalogs, and UI rendering.
packages/…/package.jsonShows the framework-neutral React core peer contract and public provider, hook, and component entry points.
packages/…/BrowserConditionStore.tsShows writable browser conditions, cookie persistence, and server snapshot handling.
packages/…/BrowserGTProvider.tsxShows the browser provider boundary and reconciliation of server results.
packages/…/ServerGTProvider.tsxShows the server provider shape used before hydration.
packages/…/clientHooks.test.tsxProtects stable React hook identities and development hot-reload updates across rendered, memoized, effect-derived, dictionary, and deferred lookups.
packages/…/index.client.tsShows the browser React boundary and its public client surface.
packages/…/index.server.tsShows the server-rendered React boundary and its protected browser setup APIs.
packages/…/initializeGTSPA.tsShows browser setup and the initial catalog readiness boundary.
packages/…/config.tsShows how Next.js build configuration joins GT runtime settings, loaders, aliases, middleware options, locale checks, and version-aware options.
packages/…/withGTConfigProps.tsDefines the configuration boundary shared by build setup and locale middleware.
packages/…/runtimeCredentials.tsDefines supported runtime credential names, legacy fallback, and the development-only key rule.
packages/…/nodeCompat.tsKeeps Node module loading and distribution asset paths available to the plain-Node Next.js config entry.
packages/…/GTProvider.tsxShows how Next.js resolves request conditions and loads snapshots before client rendering.
packages/…/defaultMiddlewareConfig.tsDefines the default locale routing policy and separates middleware settings from other configuration.
packages/…/resolveMiddlewareConfig.tsShows the precedence between defaults, withGTConfig, and direct middleware options.
packages/…/createMiddlewareRouting.tsShows how aliases, route overrides, locale availability, and configured locale identities become routing state.
packages/…/createNextMiddleware.tsShows how Next.js detects locale state and chooses pass-through, rewrite, or redirect behavior.
packages/…/Link.tsxShows the locale-aware wrapper around Next.js Link.
packages/…/localize-utils.tsShows the shared path-prefix and pathRegex rules used by links and programmatic navigation.
packages/…/useLocalizeHref.ts, packages/…/getLocalizeHref.tsShow the client and server APIs for localizing navigation paths outside a rendered link.
packages/…/client-boundary.tsxShows the Next.js client handoff and synchronization between URL locale state and server-rendered content.
packages/…/localeValidation.tsShows the boundary between accepted request locales and the configured default.
packages/…/RelativeTime.tsxShows how a Next.js server formatting component receives request conditions before shared rendering.
packages/…/initGT.test.tsShows the cache, credential, singleton, and client/server initialization contracts.
packages/…/config.test.tsShows the build configuration contract, version-gated refresh flag, locale alignment, effective locale comparison, and credential boundary.
packages/…/packageExports.test.tsProtects the Next.js runtime export choices and the published compiler asset boundary.
packages/…/middleware.edge.test.ts, packages/…/localeRoutes.edge.test.tsProtect middleware defaults, locale routing, configuration behavior, path availability, and rewrite or redirect outcomes.
packages/…/Link.test.tsxProtects locale prefix behavior for rendered links and path filtering.
packages/…/withGT.tsShows the explicit request scope used by general Node applications.
packages/…/state.tsShows Vue plugin ownership of locale state and catalog cache.
packages/…/package.jsonShows the Vue package's supported peer range and public module entry points.
packages/…/NativeGTProvider.tsxShows native catalog loading and condition updates through the provider.
packages/…/package.jsonShows React Native platform exports and the native side-effect boundary.
packages/…/gtMiddleware.tsShows the TanStack Start request boundary that protects server localization state.
packages/…/initializeGT.client.ts, packages/…/GTProvider.client.tsxShow the TanStack Start browser setup and the provider handoff that keeps locale changes in the route flow.
packages/…/package.json, packages/…/package.json, packages/…/package.jsonShow the runtime export conditions and host-version contracts that keep worker, server, browser, and RSC consumers on the correct boundary.
packages/…/package.json, packages/…/package.jsonShow the native and Vue package entry points and their supported host contracts.