generateStaticParams
Unanswered
Little Curlew posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/3.png)
Little CurlewOP
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.
![Image](https://cdn.discordapp.com/attachments/1127007718553686046/1127007719904247950/Capture_decran_2023-07-08_a_00.45.49.png)
![Image](https://cdn.discordapp.com/attachments/1127007718553686046/1127007720214646844/Capture_decran_2023-07-08_a_00.46.12.png)
7 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/3.png)
Little CurlewOP
As you can see, in [lang] Layout getStaticParams works fine
![Image](https://cdn.discordapp.com/attachments/1127007718553686046/1127008104375128164/Capture_decran_2023-07-08_a_00.47.19.png)
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
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
![Avatar](https://cdn.discordapp.com/embed/avatars/3.png)
Little CurlewOP
It’s what i figured out but that’s really weird as it’s what the actual doc example does …
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
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
![Avatar](https://cdn.discordapp.com/embed/avatars/3.png)
Little CurlewOP
Ow you can do that ??? That’s my bad then
Thanks a lot i will try this out