Last post Apr 28, 2006 09:29 AM by fanthom
Apr 28, 2006 05:57 AM|akaii|LINK
Apr 28, 2006 09:15 AM|cubeberg|LINK
Here are a few lines out of the Microsoft Press book - Developing Web Applications:
This should give you the user's language
Dim sLang as String = Request.UserLanguages(0)
And to set the current thread to that language. The first line loads formatting and comparison information. The second line forces culture-specific resources to load (if you have a localized page).
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(sLang)
Thread.CurrentThread.CurrentUICulture = New CultureInfo(sLang)
Apr 28, 2006 09:29 AM|fanthom|LINK
but dont forget that:
- Request.UserLanguages may be null, resp. can contains 0 languages
- as this is read from browser (sent by browser) and not checked, it can contain not valid cultures...