docs(react): document the Pages Router i18n config mismatch warning - #432
Open
moss-bryophyta wants to merge 1 commit into
Open
docs(react): document the Pages Router i18n config mismatch warning#432moss-bryophyta wants to merge 1 commit into
moss-bryophyta wants to merge 1 commit into
Conversation
gt-next@11.1.4 (gt#2005) warns at build time when next.config i18n locale settings disagree with gt.config.json. Both Pages Router pages already import from gt.config.json; explain why that pattern matters and name the warning users see if the values drift.
moss-bryophyta
enabled auto-merge (squash)
July 31, 2026 13:26
moss-bryophyta
requested review from
archie-mckenzie and
pie575
and removed request for
fernando-aviles
August 1, 2026 20:21
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
Documents the build-time warning added by gt#2005, shipped in
gt-next@11.1.4(published 2026-07-30).When
next.config.ts'si18n.locales/i18n.defaultLocaledisagree withgt.config.json,gt-nextnow prints a warning at build time. Nothing in the docs mentioned it.Why it matters
Both Pages Router pages already show the correct pattern — importing the values out of
gt.config.jsonso the two configs cannot drift:Neither page explained why that import matters. A reader who hardcodes the arrays instead (a natural thing to do) gets a warning with no docs to search for. This adds the missing rationale and names the warning.
Changes
react/(frameworks)/nextjs/pages-router-middleware.mdx— one paragraph after the config block explaining that importing keeps the two configs in sync, what the warning says, and that the locale comparison is order-independent.react/nextjs-pages-router-quickstart.mdx— one clause noting the values should be imported rather than repeated, and thatgt-nextwarns when they disagree. Kept short since this page already links to the routing page for details.I left
pages-router-static-site-generation.mdxalone — it already says to import fromgt.config.jsonand links to the routing page for complete setup, so a third copy would be redundant.Verification
Behavior confirmed against the published
gt-next@11.1.4, not justmain:Order-independence and the
defaultLocale-prepend normalization are confirmed ingetNextI18nConfigMismatches/haveSameLocalesinpackages/next/src/config.ts. The check is deliberately scoped to file-loaded config only — inlinepropspassed towithGTConfiggo through the existing conflict/merge paths and do not trigger this warning, so I did not claim otherwise in the docs.All five validators pass, and
pnpm run build:contentsucceeds (328+ paths).Related
While verifying the exact warning text I found the shared diagnostic formatter lowercases proper nouns, rendering
because next.js may select.... Filed upstream as gt#2016. The docs here deliberately describe the warning's meaning rather than quoting the mangled string, so this PR stays correct either way.