Closed amannn closed 2 months ago
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 | Aug 28, 2024 2:43pm |
next-intl-example-app-router | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 28, 2024 2:43pm |
next-intl-example-app-router-without-i18n-routing | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 28, 2024 2:43pm |
Summary
Adds a new
defineRouting
API that returns arouting
object that can be used to initialize the middleware as well as the navigation APIs. This provides type-safety for your i18n config with a single import and helps to ensure that your i18n config is in sync across your app.While this change is purely additional, it's encouraged to adopt
defineRouting
in existing code bases and the docs have been updated to reflect this.Migration example: https://github.com/amannn/next-intl-bug-repro-app-router/commit/0a0068405bc4e23825fd1cd593f3232ead996983
In case you're providing either
alternateLinks
orlocaleDetection
tocreateMiddleware
, these options can now be passed as a second argument:Changes
defineRouting
APIrouting
) as second param tocreateMiddleware
src/routing.ts
instead ofsrc/navigation.ts
i18n.ts
in getting started docs