docs(next): document the NEXT_LOCALE override in headersAndCookies - #427
Closed
moss-bryophyta wants to merge 1 commit into
Closed
docs(next): document the NEXT_LOCALE override in headersAndCookies#427moss-bryophyta wants to merge 1 commit into
moss-bryophyta wants to merge 1 commit into
Conversation
The headersAndCookies reference said every field defaults to the library's standard name, which is now incomplete. Since gt-next@11.1.3 (generaltranslation/gt#2004), withGTConfig repoints localeCookieName at NEXT_LOCALE whenever the Next.js config sets i18n and leaves localeDetection enabled, so Pages Router locale persistence matches what the router reads. The override is applied after props.headersAndCookies in the merge, so it wins even when localeCookieName is set explicitly. That is the part worth calling out: a reader configuring their own cookie name has no way to tell from the current docs that it is silently replaced. Also documents the opt-out (localeDetection: false). Verified against packages/next/src/config.ts and utils/cookies.ts upstream. Follow-up to #426, which flagged this gap. Verified: validate:callouts, validate:structure, validate:reference-links, and validate-links all pass.
moss-bryophyta
enabled auto-merge (squash)
July 30, 2026 00:52
Contributor
Author
|
Superseded by #430, which landed the same guidance in |
auto-merge was automatically disabled
July 30, 2026 17:21
Pull request was closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
headersAndCookiesreference in the Next.js config page says every field "defaults to the library's standard name." Sincegt-next@11.1.3(generaltranslation/gt#2004) that is incomplete:withGTConfigrepointslocaleCookieNameatNEXT_LOCALEwhenever the Next.js config setsi18nand leaveslocaleDetectionenabled, so Pages Router locale persistence matches the cookie the router actually reads.The part worth calling out
The override is applied after
props.headersAndCookiesin the merge:So it wins even when you set
localeCookieNameyourself. A reader configuring a custom cookie name currently has no way to tell from the docs that it is silently replaced. The callout documents that precedence and thelocaleDetection: falseopt-out.Verification
packages/next/src/config.tsandpackages/next/src/utils/cookies.tsupstream, not inferred from the changelog.Callout type="info"matches the existing convention in this file.validate:callouts(431 files),validate:structure,validate:reference-links(385 files), andvalidate-linksall pass.Context
Follow-up to #426, where I flagged this gap rather than expanding that PR's scope. Independent of #426 — no file overlap, so the two can merge in either order.