QuiiBz / next-international

Type-safe internationalization (i18n) for Next.js
https://next-international.vercel.app
MIT License
1.28k stars 59 forks source link

app router & pages router at the same time? #379

Closed addlistener closed 6 months ago

addlistener commented 6 months ago

I made app dir & pages dir work individually by following the guide. However my application contains both dir. Is it possible we do both?

If I have nextConfig.i18n & middleware.ts at the same time -> "Too many redirects"

If I have only middleware.ts -> Does not work for pages dir.

QuiiBz commented 6 months ago

I think you should be able to restrict the middleware to only your app router pages, using the matcher config.

addlistener commented 6 months ago

Thanks you! Though I have almost abandoned app router, I think you are leading me to a right direction.