I'm fairly new to prismic, and I can't wrap my head around how to change the multi-language URL management while using slice-machine.
What I want to achieve is to have the main language always displayed in the URL (for instance my main locale is Italian) so I'd like the home page to be whatever.com/it.
As you can see though, I'd like to also display all languages "region-free", so instead of /it-it and /en-gb I'd like them to be /it and /en respectively.
I looked everywhere on the docs and guide but I haven't found a clear explanation and can help me.
Prismic only accepts the lang, which is defined in repo settings like: "en-gb", "en-us", "fr-fr", and you want to skip regions from URL. so it will have the same treatment on "gb" and "us".
On the front-end, URL lang values are handled by the developer, so let's say you have a URL like "/en/page1" or "/fr/page2", you can apply and if check in your code to verify and map the values before triggering the query on prismic.
like if you have language from URL in a variable like lang
It works exactly as intended. So I guess on a new project I only need to create custom languages without the region go on from that (as I've seen it's not possible to edit locales once created).
Only one thing eludes me: let's say I wanted to redirect a certain route to another one: in laravel I'd work with a middleware or I'd simply "catch" that route from my route file (i.e. /routes/web.php) and redirect it.
If I'm not mistaken there's not a route file such as the linkResolver, so how would you do it? and in what file?
I'm extremely grateful for your patience and help.