If the user has their browser set to fr-CA, for instance but my site has the option to view the page in another available language (like English). How can I override the accept-language header so that I can reload using the specified language?
I was attempting to simply change the Accept-Language header and then reload the page, but I'm not sure how to do this. Any thoughts?
Ok, so I'm getting people explaining to me what localization is so I must not have asked this properly.
My site currently has globalization set to auto in the web.config so it will automatically set the thread culture to whichever language was negotiated at app start. By default, the user's browser will send the accept-language header based on the language settings for the browser which, like someone pointed out below, average users have no clue what those are, where those are, or how to change them. In any case, let's call this default behavior that the browser will handle the language headers first. However, as a FEATURE, I want to allow the user to change this accept-language header from the page. For instance, in the application, the language settings will normally be determined by cookie or by user preference (via profile settings), but on the landing/login page (particularly if this your first time logging in on a certain computer), I have no idea who you are so I only have your browser settings to go off of. But let's say that you're traveling on business and accessing this site from an american computer, the page loads in English and you can't read it and you have no idea how to change the browser language. Would it not be nice to have the option to choose your language from a drop down menu or icon or something? I think it would be.
So in order to do that, I need to be able to change that accept-language header and reload the page. This is where I'm not sure how to proceed.
navigator.language = <selected language> and
xhr.setRequestHeader but these don't seem to work.