How does the URL change when the page language changes?

Hello,

I use 'locize' for page translations and have always used English in the url routing part. The site contains multiple languages ​​and I want to change the urls according to the selected language because SEO is affected. How can I do?

Thanks in advance

Any advice?

I recommend you post screenshots explaining the problem, because I guess most people don't know what 'locize' is, it's hard to understand the problem

Locize is an online service that offers true continuous localization. The translations are managed in your locize project and published from there to the locize CDN to be consumed from your application. "https://docs.locize.com/" When processing urls, Google wants us to separate urls according to language. For example, it runs a query as "/contact?lng=en" and "/contact?lng=es" instead of '/contact' and '/contacto'. When this happens, there is a single "/contact" url for 2 different languages, and the language is determined according to the data after the question mark. My problem is that it's not suitable for Google SEO. At least that's what I know :upside_down_face:

Yes, that's right, ideally you have a url like /en/contact

The way I'd do is change all routes to accept the lang parameter:
/:lang/contact

And then you have to figure how to set Locize language to wherever is in $_PARAM.lang (I don't have time to search how to do this, I don't know if you have to necessarily use server-side binding)

And then you have to change all links to have the lang parameter? :smiling_face_with_tear:

Maybe someone has a better idea...

2 Likes