If the user has his browser for fr-CA, for example, but my site has the ability to view the page in another accessible language (for example, in English). How can I override the accept-language header so that I can reload using the specified language?
I tried to just change the Accept-Language header and then reload the page, but I'm not sure how to do this. Any thoughts?
UPDATE: Okay, so I get people to explain to me what localization is, so I shouldnโt have to ask about it correctly.
In my site, globalization is currently set to global.config, which automatically sets the culture of the stream depending on which language was agreed upon when the application was launched. By default, the user browser sends an accept-language header based on the language settings for the browser, which, as mentioned above, usually do not know what they are, or how to change them. In any case, allow this default behavior so that the browser handles the language headers first. However, as a FEATURE, I want to allow the user to change this host language header from the page. For example, in an application, the language settings are usually determined by cookies or user preferences (through the profile settings), but on the landing / login page (especially if this is your first login to a specific computer), I have no idea who you are, so I only have your browser settings. But let me say that you are traveling in business and accessing this site from an American computer, the page is loading in English, and you cannot read it, and you do not know how to change the language of the browser. Would it be nice to be able to choose your language from the drop-down menu or icon or something else? I think it will be so.
So, to do this, I need to be able to change the host language header and reload the page. This is where I am not sure how to proceed.
I tried navigator.language = <selected language> and xhr.setRequestHeader , but they don't seem to work.
javascript jquery asp.net-mvc-4 localization
Sinaesthetic
source share