Next.js Discord

Discord Forum

I cannot find a way to make proper internationalisation routing..

Unanswered
Juniper Titmouse posted this in #help-forum
Open in Discord
Juniper TitmouseOP
I'm currently working on a project where I need those kind of urls for SEO.

/nl/leasing-auto
/fr/leasing-voiture
/en/leasing-car
/nl/over-ons
/fr/a-propos-de-nous
/en/about-us

-[locale]
--[aboutTranslations]
--[leasingTranslations]

This rise an Error like so "Different slug names for the same dynamic path"
I understand that next js cannot différenciate them because they are both a variable BUT
Since I'm using generateStaticParams with dynamicParams = false;
It SHOULD understand and allow this configuration.

I couldn't find any workaround, I have seen people suggesting a catch all route [...segment], but I don't see how this will solve anything..
Let's say I generated the path, then I would have to do something like if slug = about-us return aboutPage, that so ugly right ? It's like a huge step back, it feel like building a router on top of next js router to then convert all my pages to components ?? Back to REACT then ??

Anyway, if someone can help me or have faced the same issue, I would gladly appreciate your feedback !
And if there is no workaround, is there any framework out there that can handle this smoothly ?
Thank you for reading this !

0 Replies