I\'m creating a website with ASP.net MVC 2.0 which uses two different languages (English and Persian). I want to have two different layouts for these languages, English has a le
This is the code you can use to get the Locale at the client side. Once you have the locale defined, you can dynamically include a stylesheet in the header.
if ( navigator ) {
if ( navigator.language ) {
return navigator.language;
}
else if ( navigator.browserLanguage ) {
return navigator.browserLanguage;
}
else if ( navigator.systemLanguage ) {
return navigator.systemLanguage;
}
else if ( navigator.userLanguage ) {
return navigator.userLanguage;
}
}