I have versions of my pages content for a few languages with their own domains I've set in umbraco. But in umbraco, I choose a default one, and it doesn't change according to what language user has as his local. Can I somehow change that behavior so there will be redirects to certain language versions when possible?
Okay, thanks for the advice, seems like a good way to do it. I'd like to ask for one more, though. Language-specific content comes to my controller actions via RenderModel parameter. So, at that time, content was already requested from database and put into model. I struggle to find the moment where the request is first-proccesed to determine what content to request and where RenderModel is created.
Content language according to local
I have versions of my pages content for a few languages with their own domains I've set in umbraco. But in umbraco, I choose a default one, and it doesn't change according to what language user has as his local. Can I somehow change that behavior so there will be redirects to certain language versions when possible?
Hi,
Umbraco don't have anything automatic for this requirement. So, you can add your code instead.
You can do it using Request.Headers["Accept-Language"]. This will give you browser language and you can redirect based on it.
Cheers,
Shaishav
Okay, thanks for the advice, seems like a good way to do it. I'd like to ask for one more, though. Language-specific content comes to my controller actions via RenderModel parameter. So, at that time, content was already requested from database and put into model. I struggle to find the moment where the request is first-proccesed to determine what content to request and where RenderModel is created.
is working on a reply...