Re: Override culture/language based on user's profile?

  •  04-20-2009, 1:47 PM

    Re: Override culture/language based on user's profile?

    I found a solution!  I added this to Global.asax.cs:
     

    protected void Application_AuthenticateRequest(Object sender, EventArgs e)

    {

    User user = CSContext.Current.User;

    if (user.Profile.Language == "de")

    // fixes a bug where neutral cultures < en-us are ignored

    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de-DE");

    else

    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(user.Profile.Language);

    // set config so that CurrentUICulture is used

    CuteChat.ChatApi.SetConfig("CultureType", "Server");

    CuteChat.ChatApi.SetConfig("CurrentCulture", "");

    }

    --Troy
View Complete Thread