6

How can I get the selected language in the screenshot, from inside of a webpart?

alt text http://thomasstock.net/currentlanguage.png

I'm using SharePoint 2010. My webpart is a "visual web part" created in VS2010.

I'm trying things like SPContext.Current.Web.CurrentUser.RegionalSettings and SPContext.Current.Web.Language" but ofcourse these things have nothing to do with that setting. :-|

Can someone please help me? What property am I looking for.

1
  • Please note. If user changed UI language via interface, System.Threading.Thread.CurrentThread.CurrentUICulture.LCID keeps previous value. Use cookie "lcid" to get actual culture. Commented Sep 25, 2015 at 8:21

1 Answer 1

11

Use the System.Threading.Thread.CurrentThread.CurrentUICulture.LCID to get the current LCID

1
  • also System.Globalization.CultureInfo.CurrentUICulture.LCID is the same. Commented Apr 30, 2013 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.