next-right-now icon indicating copy to clipboard operation
next-right-now copied to clipboard

i18n redirect bug

Open samuelcastro opened this issue 3 years ago • 2 comments

Describe the bug On catch-all routes page, if you try to change the language, it'll fail redirecting the user to the following route: https://nrn-v2-mst-aptd-at-lcz-sty-c1.vercel.app/fr/demo/native-features/example-optional-catch-all-routes/[[...slug]]?slug=you%2Ccan%2Cgo%2Cto%2Cany%2Cdepth%2Cyou%2Cwant

To Reproduce Steps to reproduce the behavior:

  1. Go to https://nrn-v2-mst-aptd-at-lcz-sty-c1.vercel.app/en/demo/native-features/example-optional-catch-all-routes
  2. Click in the flag to change the language.
  3. See the url

Expected behavior Be able to change the language properly.

samuelcastro avatar Mar 21 '21 21:03 samuelcastro

Yeah, it's a bug in the i18nLink component if I remember correctly. It's basically because it doesn't know about query params that are specific to the catch-all page and don't convert them.

I'm not sure how to fix that 🤔

Vadorequest avatar Mar 21 '21 23:03 Vadorequest

This is happening in the i18nRedirect fn as well.

samuelcastro avatar Mar 21 '21 23:03 samuelcastro