-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Unable to Use 'router.replace' with Custom Locale Parameter #420
Comments
This is my temporary solution: // e is the selected locale
router.push(e + '/' + pathname.replace(/\/(de|en)?\/?/,'/')) |
Thank you for your report. Unfortunately, the reproduction is missing, and as such we cannot investigate this issue. Please add a reproduction to the issue, otherwise it will be closed automatically. Templates: Creating a good bug report takes time. To help us resolve the issue quickly, please simplify the reproduction as much as possible by removing any unnecessary code, files, and dependencies that are not directly related to the problem. The easier it is for us to see the issue, the faster we can help you. Apart from the reproduction, make sure to include the precise steps on how to reproduce the issue, e.g.:
Thank you for your understanding! FAQI've included a reproduction, what is missing? This comment might have been added because your reproduction doesn't point to either a CodeSandbox or a public GitHub repository where the issue can be reproduced. Please make sure:
|
This issue has been automatically closed because it is missing a reproduction and there hasn't been any activity for 7 days. If the problem persists, please create a new bug report. |
I'm experiencing the exact same problem |
Me too :) |
Description
I know this is not directly related to next-intl, but it's recommended in the docs and i need an alternative.
I encountered an issue while attempting to use the 'router.replace' method in combination with a custom 'locale' parameter. However, I received an error message stating, "Argument of type '{ locale: string; }' is not assignable to parameter of type 'Url | undefined'. Object literal may only specify known properties, and 'locale' does not exist in type 'UrlObject'.ts(2345)."
Mandatory reproduction URL (CodeSandbox or GitHub repository)
https://codesandbox.io/p/sandbox/next-intl-bug-template-forked-yow8ep
Reproduction description
Expected behaviour
The user should be redirected to the current page with the correct translation provided.
The text was updated successfully, but these errors were encountered: