Get the current UI language from a webpart

thomas.stock
  • Get the current UI language from a webpart thomas.stock

    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.

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

Tags
language web-part
Related questions and answers
  • --------------------------- Things I have tested: I can successfully upload my .webpart definition to the web part gallery, and the web part works. I can successfully add the web part to the page...()); } UPDATE: Based on feedback from Wictor, I tried the following: <?xml version="1.0" encoding="utf-8"?> <webParts> <webPart xmlns="http://schemas.microsoft.com/WebPart/v3"> <... correctly for the Content Editor Web Part (based on sample code), however when I replace the Content Editor Web Part definition with one for my own web part I get the following error

  • Audience of the webpart to 'Staff'. The idea is that anonymous viewers can't see the web part, but logged-in members of staff can see the webpart. This works fine, as long as I am browsing the site from the server on which SharePoint is running, using the internal domain name (e.g. http://localhost:5050/site). If I view the site home page while not logged in, I can't see the webpart -- this is the correct behaviour. However, if I view the site via the public address (e.g. http://www.realaddress.co.uk:5050/site) while not logged in, I can see the webpart. (I shouldn't be able

  • (I have also asked this question on Stack Overflow) I have a SharePoint feature I'm using to add some custom aspx files to the Pages Library. When I activate the feature, I can visit the pages...="~masterurl/default.master"%> <%-- deliberately left empty --> (yup, it's empty!) Addendum When I "visit the pages in-browser" I mean navigate to their URLs manually: http://myserver:PORT/subsite/Pages/Example.aspx When I "View All Site Content" I am looking at the contents of the "Pages" list: http://myserver:PORT/subsite/Pages/Forms/AllItems.aspx

  • We have created a document library template to facilitate the rapid deployment of multiple document libraries with identical structure. The template has been created within the same site and the same collection as where it will be deployed, but when we try to deploy it we get an error stating "The language is not supported on the server". I don't understand why the template wouldn't match the language of the site it was created in. Can anyone point me in the right direction here? Unfortunately I'm limited in a corporate environment, so I can't access the central admin or remote into the farm.

  • I have a webpart i build using WSpBuilder and it works OK. When i use Deploy from Visual Studio it installs the WSP sharepoint and add the webpart to the webpart gallery. But it seems the feature...; </File> </Module> </Elements> But when i go to the site features i can see the feature but when i activate it it does puts the webpart in the gallery but when i deactivate it it doesn't remove it but i get error: Failed to instantiate file "myStoreComms.webpart" from module "WebPartPopulation": Source path "myStoreComms.webpart" not found. Any ideas.. .what

  • I've created a Custom List ('Tooltips') in SharePoint. After this I used SPSource to reverse engineer the list into a feature. After installing and activating this feature, I want to add this list in a WebPart zone. When doing this, I get an error message : Tooltips: List View Web Part could not be added, list may be hidden. What's wrong with the list? feature.xml <?xml version="1.0" encoding="utf-8"?> <Feature Id="70d49f3d-233a-482d-97e3-dcec2c236171" Title="MyApp - Tooltips" Description="Creates a Tooltips list which can be used for mouse-over texts

  • I have a webpart that is part of a larger solution, deployed as a WSP using WSPBuilder. I can see the SafeControl entry in the web.config and can see that the assembly has deployed to the GAC. The solution reports as installed OK in Central Admin and the feature is activated at the site collection. When I attempt to add the webpart to a page, I'm getting an error stating that the "Type could not be found or is not registered as safe." I have removed this solution from MOSS and completely re-created the webpart, in case I've messed up GUIDs or something. I'm not sure what to check next. Any

  • Every where I'm reading about setting up Excel Services for delegation so that it can connect to Analysis Services running on separate server is based around using Claims based authentication to authenticate to the web application. However, right now we are using Classic Mode Authentication, and I can't find ANY information on how to set things up in this scenario. Is it even possible to get this going without using Claims Authentication?

  • I’m trying to write a Http Handler to generate rss xml (based on the CKS code). I want to be able to get the list/library that the end point of the url is referring to. For example if my Url is: http://example.org/pressreleases/pages/rss.xml I want to be able to get the pages library of the 'press releases' web. On a side note if I'm going about this in the wrong way please let me know. Update 1 It may be easier for me to show my code (incase of retardation) public void ProcessRequest(HttpContext context) { try { SPList list

Data information