generateStaticParams
Unanswered
walid-mos posted this in #help-forum
Hello,
I am trying to use differente locales in my actual project, followed Next doc + their example https://github.com/vercel/next.js/blob/canary/examples/app-dir-i18n-routing/
My getStaticParams is called, but rootLayout does receive nothing from it, the underlying problem is that it forces then to have only SSR and no SSG pages.
I used a workaround, by calling getStaticParams in a layout in /[lang], but it is redondant and i still get incorrect html with no lang attribute.
I am trying to use differente locales in my actual project, followed Next doc + their example https://github.com/vercel/next.js/blob/canary/examples/app-dir-i18n-routing/
My getStaticParams is called, but rootLayout does receive nothing from it, the underlying problem is that it forces then to have only SSR and no SSG pages.
I used a workaround, by calling getStaticParams in a layout in /[lang], but it is redondant and i still get incorrect html with no lang attribute.
7 Replies
@walid-mos Hello,
I am trying to use differente locales in my actual project, followed Next doc + their example https://github.com/vercel/next.js/blob/canary/examples/app-dir-i18n-routing/
My getStaticParams is called, but rootLayout does receive nothing from it, the underlying problem is that it forces then to have only SSR and no SSG pages.
I used a workaround, by calling getStaticParams in a layout in /[lang], but it is redondant and i still get incorrect html with no lang attribute.
you cannot access a param in upper layouts. for this i did have a prototype the other day that worked https://discord.com/channels/752553802359505017/766433464055496744/1125774882387525672 you can have a look
It’s what i figured out but that’s really weird as it’s what the actual doc example does …
@walid-mos It’s what i figured out but that’s really weird as it’s what the actual doc example does …
in the official doc example, they have several root layouts
there is no
app/
[lang]/
layout.tsx <- root layout
page.tsx
there is no
app/layout.tsx
that's why it works
Ow you can do that ??? That’s my bad then
Thanks a lot i will try this out