locked
How to assign CultureInfo.InstalledUICulture to a webpage culture RRS feed

  • Question

  • User385091215 posted

    Dear,

    Please any one tell me,

    How to change the browser language culture to InstalledUICulture.

    Thank You

    Regards

    jagadeesh

    Wednesday, March 7, 2012 12:38 AM

Answers

  • User-1827453801 posted

    Probably need to assign it to System.Threading.Thread.CurrentThread.CurrentUICulture in your applications BeginRequest event.

    You can read it from HttpContext.Current.Request.UserLanguages. Its a string array in order of the user's language preference. For example: ["en-AU", "en-GB", "en-US"]

    Just take the first value and use it to the create an instance of CultureInfo.

    http://msdn.microsoft.com/en-us/library/ky2chs3h.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 7, 2012 5:30 AM

All replies

  • User-1827453801 posted

    Probably need to assign it to System.Threading.Thread.CurrentThread.CurrentUICulture in your applications BeginRequest event.

    You can read it from HttpContext.Current.Request.UserLanguages. Its a string array in order of the user's language preference. For example: ["en-AU", "en-GB", "en-US"]

    Just take the first value and use it to the create an instance of CultureInfo.

    http://msdn.microsoft.com/en-us/library/ky2chs3h.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 7, 2012 5:30 AM
  • User1751268424 posted

    Hi,

    Please see video at the following site http://www.pluralsight-training.net/microsoft/players/PSODPlayer?author=scott-allen&name=mvc3-building-infrastructure&mode=live&clip=0&course=aspdotnet-mvc3-intro at section Globalization, and Resource

    Have fun

    Wednesday, March 7, 2012 10:44 AM