Internationalization redirect to the current locale using middleware
Unanswered
Ninhache posted this in #help-forum
NinhacheOP
Actually, there's an example to how we can implement i18n to an app router folder, but the example middleware suck, first of all he isnt taking search params.. but anyways easy to add
Meanwhile, on router.push there is no lang handling that's means if we want to go to an another page, you have to add the lang before route :
Same for the Link..
is there a way to handle all that "shit" in the middleware ?
i've tried but we can't really know where the request comes from.. if we had the "last request url" we could simply parse it to get the lang but that's not a solution
Meanwhile, on router.push there is no lang handling that's means if we want to go to an another page, you have to add the lang before route :
router.push('/home') -> router.push('/en/home')Same for the Link..
is there a way to handle all that "shit" in the middleware ?
i've tried but we can't really know where the request comes from.. if we had the "last request url" we could simply parse it to get the lang but that's not a solution