I'm trying to internationalize my website through the subpath feature of next.js.
Here is my module.export
:
/* eslint-disable prettier/prettier */
module.exports = {
i18n: {
defaultLocale: 'fr',
locales: ['en', 'fr'],
},
react: {
useSuspense: false,
wait: true,
},
}
Here is the structure of my Page
folder:
.
│ 404.js
│ about.js
│ blog.js
│ index.js
│ projects.js
│ tags.js
│ tree.txt
│ _app.js
│ _document.js
│
└───blog
│ │ [...slug].js
│ │
│ └───page
│ [page].js
│
└───tags
[tag].js
Everything works with subpath when I'm in the root page directories. localhost:3000/about
, localhost:3000/en/about
works. localhost:3000/fr/about
redirect as localhost:3000/about
as intended.
But when I try to access a statically generated page in a folder, in the en
subpath (like localhost:3000/en/blog/article1
for example, I get a 404.
How can I make sure the site statically generates pages also for the en
subpath ?