Skip to content

fix(i18n): use correct defaultLocale when domains array is present on default host - #25

Open
hbrooks wants to merge 3 commits into
canaryfrom
demo/pr-93151
Open

fix(i18n): use correct defaultLocale when domains array is present on default host#25
hbrooks wants to merge 3 commits into
canaryfrom
demo/pr-93151

Conversation

@hbrooks

@hbrooks hbrooks commented May 28, 2026

Copy link
Copy Markdown

Originally PR vercel#93151 in vercel/next.js by @hammadxcm

hammadxcm added 3 commits May 26, 2026 15:12
… default host

When a `domains` array is configured in i18n and the request is served
from the default domain (e.g., localhost), `defaultLocale` was
incorrectly set to a configured domain's value because
`detectDomainLocale` matched on the detected locale rather than
hostname. Remove `domainLocale?.defaultLocale` from the fallback chain
in `RouteModule.prepare()` since `base-server.ts` already sets the
correct value in request metadata via hostname-only matching.

Fixes vercel#90131
Adds /go-BE and /do-BE cases that exercise the item.locales match branch
of detectDomainLocale (distinct from the defaultLocale match), verifying
the request defaultLocale stays en-US on the default host.
@hammadxcm

Copy link
Copy Markdown

@hbrooks Let me know If you need anything from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants