next-translate: Routing Errors with NextJS 13's App Directory

What version of this package are you using? 2.4.4

What operating system, Node.js, and npm version? macOS 13.4.1 (22F82) // Node.js v18.16.0 // npm 9.5.1 // NextJS 13.4

What i did I used the app router and added all my pages to /[lang]. I also added the path in my i18n.json:

{
  "locales": ["en"],
  "defaultLocale": "en",
  "pages": {
    "/[lang]/(index)": ["index"], (I added all my files for / in the folder (index) and wasn't sure which one to use)
    "/[lang]": ["index"],
    "/[lang]/contact": ["contact"],
    "/[lang]/story": ["story"]
  }
}

What happened? When i go to my page, the link can’t be found (Error: 404). When i go to /en, the page gets displayed but the translations do not get loaded.

What did you expect to happen? After going to /, you are redirected to the correct locale with the correct translations loaded.

Are you willing to submit a pull request to fix this bug? /

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

@PixelPage-YT would be very useful if you can share a reproducible repo example, thanks!

that’s the problem. it works completely fine in other projects. i need to find the problem… It might be useful to detect when the namespaces can’t be loaded and log the error why they can’t be.