Next.js Discord

Discord Forum

Error: You cannot use different slug names for the same dynamic path (route internationalisation)

Unanswered
Nebelung posted this in #help-forum
Open in Discord
NebelungOP
Hey all,
I have a question about dynamic routes with internationalisation. looking at demo from sanity (https://github.com/sanity-io/demo-course-platform/tree/main/web/app/%5Blanguage%5D) can i have another dynamic route (now there is [course]) for other pages?

I want to add About page and would like it to have link (url/en/aboutand for dutch url/nl/over). When I tried it it throws error (which makes sense ofc):
Error: You cannot use different slug names for the same dynamic path ('about' !== 'course').

Is it even possible? I'm using App router with Sanity API.

4 Replies

No i dont think you can, cause next cant tell which route you are trying to fetch out of the two.
NebelungOP
Riight. Do you maybe know what kind of logic to use to make the multilingual website that has different urls for each language in next js?
Unfortunately i dont think there is another way other than changing the path so that there arent two dynamic routes at the same hierarchy level
NebelungOP
Okay, thank you for helping