Issue with multiple locals

Hello team!

We have recently updated our repository and started implemented the new nextjs prismic setup together with slice-machine and everything has worked as expected.

We have now however run into issues with getting mutiple locales to work in the project.
I have followed the guide Multilingual Templating with Next.js - Documentation - Prismic and looked at the example github repo but can't seem to get it to work as expected.

So when setting up a Language-switcher, firstly, the PrismicLink component complains about the locale prop, that it doesn't exists on the PrismicLink, which in the first place seems strange since that seems to be the way to pass locale?

Secondly, when pressing the language switcher to switch to another language, it adds the locale before the url to the page like. www.ourdomain.com/en-gb/test , instead of www.ourdomain.com/test/en-gb as it does in the example. The link resolver looks as it does in the example:
Screenshot 2022-04-13 at 09.09.53

Any help and directions to be able to solve this issue would be greatly appreciated!

Best regards,
Seb

Hi Seb,

I believe there might be a point missing in our guide which you shared, can you try defining this in your _app.js file:

And pass it to the PrismicProvider component:

If this works I'll update the guide.

For the second query about the position of the language code, which example are you referring to? The multi-language example has the code before the page URL:
https://nextjs-starter-prismic-multi-language.vercel.app/fr-fr

Thanks.

Hi @Phil, in my case this also throws an error, so is there any other solution you have?

Hello @davidfaladore

Thanks for reaching out to us.

Can you explicitly describe what error you get? It would be great if you could create another topic with details.

Thanks,
Priyanka