Closed as not planned
Description
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
- Follow the documentation link provided (https://next-intl-docs.vercel.app/docs/routing/navigation#userouter) to learn about the recommended approach for routing with internationalization using 'router.replace'.
- Implement the 'router.replace' method with the 'pathname' and 'locale' parameters in your Next.js application as described in the documentation.
- Observe the TypeScript error mentioned above when attempting to compile the application.
Expected behaviour
The user should be redirected to the current page with the correct translation provided.