locked
Localization returns "de". RRS feed

  • Question

  • User-129749642 posted
    In my application I fetch the users culture by doing : string[] T = HttpContext.Current.Request.UserLanguages; if(T.Length > 0) m_strLocale = T[0] ; else m_strLocale = "en-US"; It works fine with most users. However there is one german that claims it's getting just "de" instead of "de-GE". (i've printed the locale onscreen for debugging purposes) Is this possible? And how can I catch this? --W
    Wednesday, November 17, 2004 2:37 AM

All replies

  • User-158764254 posted
    it's certainly possible. his browser must be set to a plain "DE" Browsers support Laguage settings that cannot be used as Cultures. you could try catching any 2 character Languages and map them back to a default 5 character culture thats appropriate for the Language...
    Thursday, November 18, 2004 7:58 PM
  • User-129749642 posted
    Ha thanks, are there any functions available that convert a language to it's closest (default) culture? Or I have to make something up for myself?
    Friday, November 19, 2004 5:30 AM
  • User-158764254 posted
    None that i've seen. i localize my site by using the first 2 characters to determine which language to present. if the browser language is actually a culture, then i set the thread - otherwise the culture stays en-US.
    Friday, November 19, 2004 7:32 AM