scottrippey / next-router-mock

Mock implementation of the Next.js Router
MIT License
401 stars 38 forks source link

Using `next/link` with the locale property. #80

Open brunohoraeero opened 1 year ago

brunohoraeero commented 1 year ago

Hi, I have a language selector where I render every <NextLink /> passing the property locale so the URL uses the correct locale. But this is not being reflected and actually ignored by Link.

I was expecting that

<Link href={{ pathname: "/asdf", query: { test: "1234" }} locale="en" />

to result in something like /en/asdf?test=1234, but it is omitting the /en part.

Any ideas what part of the next/link I may need to mock to be able to test this?

titenis commented 1 year ago

This is no help, but it looks like locale support is still missing: https://github.com/scottrippey/next-router-mock#not-yet-supported