You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem with this configuration is that it assumes every first parameter is the language. For instance, if you have a page /example and are working with localePrefix: 'as-needed', it will incorrectly interpret 'example' as your language. Additionally, if I'm using this configuration, it doesn't support dynamic <Link> components. Therefore, if you're on the language /de and link the user to the page 'example', it will generate /example instead of /de/example.
But I feel like the old middleware works better for Next.js:
Based on feedback from users, we've switched to localePrefix: 'always' as the default, as there's typically less to consider for this to work reliably.
Link to page
https://next-intl-docs.vercel.app/docs/getting-started/app-router#middleware
Describe the problem
Right now the docs has the following config for the middleware:
The problem with this configuration is that it assumes every first parameter is the language. For instance, if you have a page
/example
and are working withlocalePrefix: 'as-needed'
, it will incorrectly interpret 'example' as your language. Additionally, if I'm using this configuration, it doesn't support dynamic<Link>
components. Therefore, if you're on the language/de
and link the user to the page 'example', it will generate/example
instead of/de/example
.But I feel like the old middleware works better for Next.js:
Also a suggestion to make
localePrefix: 'as-needed'
, I believe this is better for SEO ;)The text was updated successfully, but these errors were encountered: