using i18n in app router and pages router at the same time #63670
Replies: 2 comments
-
Found this issue after searching and trying endless times. Think it's easy to achieve the wanted behaviour. See: #53724 |
Beta Was this translation helpful? Give feedback.
-
You need to first move away from nextConfig.i18n to an alternative implementation like the mixdleware approach as documented in the migration guide. You can then incrementally adopt app router. Be warned that it does result in extra round trips to the middleware to rewrite paths. There is a “good to know” that hints at it here: https://nextjs.org/docs/pages/api-reference/components/link#middleware
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey
I have an app that runs on the pages router for now, and we would like to migrate to the App router inclemently.
Now I want to add new page (APP router) as a new home page with a path =
/en-de
I tried the documentation approach of using a middleware but it was overriding the i18n part config in
next.config.js
any ideas how to achieve that?
Beta Was this translation helpful? Give feedback.
All reactions