Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Resolve locale for navigation APIs consistently from i18n/request.ts in react-server like all other APIs do (#1459) #1459

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

amannn
Copy link
Owner

@amannn amannn commented Oct 24, 2024

Previously, a locale of undefined could have ended up in your navigation APIs in case the middleware didn't run as part of the request and setRequestLocale wasn't used. Now, we resolve from i18n/request.ts for this case too, potentially taking a fallback locale into account.

Note however that this is more often than not the result of an invalid middleware config (see middleware troubleshooting).

Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 9:22am
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 9:22am
next-intl-example-app-router-without-i18n-routing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 9:22am

@amannn amannn marked this pull request as ready for review October 24, 2024 09:22
@amannn amannn changed the title fix: Resolve locale for navigation APIs consistently from config in react-server like all other APIs do fix: Resolve locale for navigation APIs consistently from i18n/request.ts in react-server like all other APIs do (#1459) Oct 24, 2024
@amannn amannn merged commit 8c6d5ff into main Oct 24, 2024
9 checks passed
@amannn amannn deleted the fix/nav-apis-locale-config branch October 24, 2024 13:30
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.

1 participant