nuxt-i18n: 6.10.1
nuxt: 2.12.2
https://codesandbox.io/s/romantic-neumann-y1bd1?file=/nuxt.config.js
I want to prerender 6 pages for the route of "pages\gen_id\index.vue".
In the page I console.log the payload once it's received in the async data method.
Check the console. You will see it only logged out the payload for pages with the default locale. ("en/gen/1", "en/gen/2"). Meaning only 2 pages of the initial 6 will be pre-rendered.
Now comment out the "fallbackLocale" option in the i18n object in nuxt.config.js
"fallbackLocale" option should not interefere with static page generation.
When "fallbackLocale" option is enabled, pages which are not of default locale do not get pre-rendered.
I can see this happening as the module will redirect to default locale if there is no cookie set yet and I'm assuming that during generation cookies are not sent or saved. This will probably also happen with alwaysRedirect: true.
It probably makes sense to special-case generation of pages. It would just need to be reliably detectable from a plugin. I will have a look at some point.
EDIT: Actually it's enough that it's detectable from a module and that should be possible.
Resolved by #718 (spinned out from #715)
Most helpful comment
I can see this happening as the module will redirect to default locale if there is no cookie set yet and I'm assuming that during generation cookies are not sent or saved. This will probably also happen with
alwaysRedirect: true.It probably makes sense to special-case generation of pages. It would just need to be reliably detectable from a plugin. I will have a look at some point.
EDIT: Actually it's enough that it's detectable from a module and that should be possible.