i18next / next-app-dir-i18next-example-ts

Next.js 13/14 app directory feature in combination with i18next
https://locize.com/blog/next-app-dir-i18n/
117 stars 29 forks source link

not-found error page doesn't work under [lng] folder #5

Open mikhailovenator opened 10 months ago

mikhailovenator commented 10 months ago

Question

not-found error page doesn't work under [lng] folder. I can only add it in app root folder, but this page can't have "lng" param and it should have root layout. We can't have root layout like in app folder because we don't have lng param:

<html
      lang={lng}
      dir={dir(lng)}

Is it possible to add not-found error page in [lng] folder? My main goal is to have localizable not-found error page. What would you suggest?

To Reproduce

I am using Next.js 13.5.6 and your repo as an example.

Expected behavior

I guess it is Next.js behavior.

adrai commented 10 months ago

You can try to do something like this? https://github.com/i18next/next-app-dir-i18next-example/commit/abd7cf0963a4b545057ff922c25677fe3907ef96

mikhailovenator commented 10 months ago

Applied https://github.com/vercel/next.js/discussions/50034#discussioncomment-6347314 workaround