I'm developing a Next.js project for the first time. The site will support 6 languages. English, Italian, Russian, Turkish, Greek, Serbian, and Arabic. What I need to do is the following.
I want to set up a structure like:
www.domain.com/en/products
www.domain.com/it/prodotti
www.domain.com/tr/urunler
But I don't want to create separate files for each language. I want to manage everything from a single file and just have the URL change based on the selected language. The content on the page will not come from any JSON file; it will be provided via an API in the appropriate language. I just need to set up this URL structure.
I've been struggling with this for 3 days, and the resources I've found online mostly show how to do it using JSON files. I tried that, but I can't progress any further. What should I do next?
middleware.ts enter image description here
i18n.ts enter image description here
File construction is like this enter image description here
What I'm trying to achieve is essentially what's described here: https://next-intl-docs.vercel.app/docs/routing#pathnames, but I'm not sure how to implement it.
I created a config file and wrote a few things in it, but I don't know where to import it or if I need to configure something in my pages. Please help. Thank you.
I've tried quite a few things, but since I'm new to this, I haven't been able to reach a solution.