SSR API
Import server helpers from @linguanahq/react/ssr.
resolveRequestLocale(input)
type ResolveRequestLocaleInput = {
request: Request;
override?: string | null;
userPreference?: string | null;
supportedLocales: readonly string[];
defaultLocale: string;
cookieName?: string;
};Reads the configured cookie (default linguana_locale) and Accept-Language, then delegates to the shared precedence algorithm. It returns one of the supported matches or the default.
createRequestHydrationState(locale, catalogs)
Returns schema-versioned LocaleHydrationState after validating every catalog. Pass it unchanged to LocaleProvider.hydrationState on the initial render.
Precedence
- Explicit application override.
- Signed-in preference supplied by the host.
- First-party cookie.
- Weighted
Accept-Languagematch. - Project default.
Exact locale matches win before language-only matches.
See also
Reference server language selection and keeping the browser in sync.
Last updated October 3, 2026
Did this page get you to a working result?