i18n: rename locale cookie to NEXT_LOCALE (Next.js convention)

This commit is contained in:
2026-08-24 19:06:06 +02:00
parent 21b948a4f8
commit f919c288b2
7 changed files with 95 additions and 7 deletions
+8 -1
View File
@@ -3,7 +3,14 @@ import type { I18nConfig } from './types.js'
import { getLocaleCodes, isValidLocale } from './helpers.js'
/** Cookie name the template uses to persist a visitor's locale choice. */
export const LOCALE_COOKIE_NAME = 'ipal-locale'
/**
* Cookie name for the persisted locale choice. Uses NEXT_LOCALE — the convention
* Next.js and its i18n ecosystem expect — so the cookie is interoperable with
* other libraries that read the active locale (instead of a plugin-specific
* name). Written only under functional consent; cleared when that consent is
* withdrawn (see consent cookieMap).
*/
export const LOCALE_COOKIE_NAME = 'NEXT_LOCALE'
type NegotiateLocaleArgs = {
/** Raw Accept-Language header value */