App directory migration to multilingual
Unanswered
Mississippi Kite posted this in #help-forum
Mississippi KiteOP
Hello, did anyone have to migrate to app directory with a multilingual app? Right now the docs for pages mention one should have the i18n property in next config. BUt for app directory to work this can't exist..now if you ahve to run pages & app directory in paralell (as one is also encouraged and probably should) this is basically impossible it seems?
Any tips? Should one first migrate off of i18n on the pages so that the multilingual approach works for both?
Any tips? Should one first migrate off of i18n on the pages so that the multilingual approach works for both?
4 Replies
did you try creeating a folder inside app like this app/[lang] and put all the files inside, and doing it thru the middleware?
https://nextjs.org/docs/app/building-your-application/routing/internationalization
I think this way only affect the content inside lang folder and pages get the old config? not sure if it works on both at same time, but if this doesn't work, yeah I would migrate first all the pages to app
https://nextjs.org/docs/app/building-your-application/routing/internationalization
I think this way only affect the content inside lang folder and pages get the old config? not sure if it works on both at same time, but if this doesn't work, yeah I would migrate first all the pages to app
Mississippi KiteOP
Yes I created a structure like
[lang]/* for all pages. They still get affected by the i18n settings, I have seen others mentioning the same e.g. https://github.com/vercel/next.js/issues/53724did you try the workaround that they mention on that issue? using next-intl routing middleware
https://github.com/vercel/next.js/issues/53724#issuecomment-1994475042
https://github.com/vercel/next.js/issues/53724#issuecomment-1994475042
Mississippi KiteOP
That's probably my next attempt..still looks like most just don't upgrade. maybe that's something to consider also. posted my thoughts in that issue as well. I think its wild that people are in this situation with using something like Next.js (no real path to migrate still and app router pushed so heavily not only from next but from react itself)
This approach also requires you to refactor the pages, which..is a total nightmare. one is migrating to app directory progressively..if that requires changing pages. e.g. replacing Links and router.locale, that means hundreds of changes in a large app. The focus should be on the new pages with app roiuter..not refactoring 2 apps (pages and app router)
This approach also requires you to refactor the pages, which..is a total nightmare. one is migrating to app directory progressively..if that requires changing pages. e.g. replacing Links and router.locale, that means hundreds of changes in a large app. The focus should be on the new pages with app roiuter..not refactoring 2 apps (pages and app router)