We are trying to add locales using SSG according to the docs: https://nextjs.org/docs/advanced-features/i18n-routing#dynamic-routes-and-getstaticprops-pages
Our config is:
i18n: {
locales: ['sv', 'en'],
defaultLocale: 'sv',
},
According to the docs, the defaultLocale should be rendered at the root. So when we return the path like this (according to the docs):
export const getStaticPaths = ({ locales }) => {
return {
paths: [
// if no `locale` is provided only the defaultLocale will be generated
{ params: { slug: 'foo' } },
],
fallback: true,
}
}
It will build a /blog/foo in Swedish. However, when we visit /sv/blog/foo (after build & start) it will show the same page, and it also says so in the build summary:
├ ● /blog/[slug] (367292 ms) 1.33 kB 372 kB
├ ├ /sv/blog/foo (12555 ms)
It seems odd that next generates duplicate pages for static sites with dynamic routes, and I can’t find anything that explains this. Does anyone know if this is a feature or bug?