Select culture based on URL?

Topics: General
Dec 27, 2012 at 10:22 PM

Hi,

Is it possible to select the culture based on the url given?

 

Eg, currently you select the culture and it redirects you to the specific homepage (/en-US or /en-GB) but is it possible to instead give the user the '/en-GB' url and it will change the culture to en-GB? That way i can change the culture for the user without them having to select it manually?

 

Alternatively, could you do it with the IP address location?

 

Thanks

Coordinator
Jan 3, 2013 at 8:11 AM
Edited Jan 3, 2013 at 8:14 AM

Hello,

Yes, I assume it's possible to achieve by creating an additional implementation of the ICultureSelector interface, that will check for request url.

Regarding IP address location - yes, it's also possible the same way, but you will need a third-party service or library to check IP address location.