locked
Browser Localization RRS feed

  • Question

  • User-845090355 posted

     Hi,

    I've searched the forums and online looking for a way to retrieve the browsers current localization settings.

    The only results I've found don't actually get the broswers settings but create a session object in order to perform adequate localization. I've also seen this being done by query string, but in all cases it's the application dictating the language, not the browser telling the application that it is running in another language.

     

    If I have my broswer (IE 8) set to "fr-CA" for example, is there a way I can get that value in the c# code behind file?

     

    Thank you for all your help.

    Alex

    Wednesday, September 2, 2009 11:28 AM

Answers

  • User-1315512054 posted

    Hello,

    You could get the user languages with HttpContext.Current.Request.UserLanguages;

    Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 3, 2009 4:26 AM

All replies

  • User-1315512054 posted

    Hello,

    You could get the user languages with HttpContext.Current.Request.UserLanguages;

    Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 3, 2009 4:26 AM
  • User-845090355 posted

     Thank you!!

    I'd like to specify for anyone with the same question that it is actually

    HttpContext.Current.Request.UserLanguages[0];

    in order to get the current preffered language, because the user can in fact have multiple prefferences in his/her browser settings.

    Thanks again for the answer!

    Thursday, September 3, 2009 9:21 AM