-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Locale prefix should be removed from Link href with 'as-needed' middleware #647
Comments
The link points to Note that this only applies if you're switching the locale. If you're already on the I'm closing this since this is already working as intended. In 3.0 we've switched the default for Hope this helps! |
hi @amannn , because we are using I forked the above sandbox and changed the
Besides this, is there a way to not auto redirect to the unprefixed version and localized path? Current if you visit Thanks a bunch! |
hi @amannn I'm not sure to understand "because we don't know about the as-needed strategy of the middleware in this situation". LocalePrefix strategy isn't something decided at project layer ? Why it should be inferred from somewhere, appart from project config? In the meantime to avoid all my pages not using the default languages, and that are pointing to the default locale, having a "known in advance" redirection, I had to use a wrapper arround next-intl Link to use either next-intl Link or Next default Link. something like this
|
Description
Go on a page with a local that is not the default locale.
The Link href is not respecting setting 'as-needed' from middleware and therefore is displaying the local prefix from the default local.
Mandatory reproduction URL (CodeSandbox or GitHub repository)
sandbox
Reproduction description
Steps to reproduce:
Expected behaviour
Whatever the current local is, the Link href should not display the local prefix with 'as-needed' middleware.
The text was updated successfully, but these errors were encountered: