I want to update the title of a webpart programmatically for a specific language. I read it's possible with "SPWeb.SupportedUICultures". Does anyone know how to do?

Thank you for your help.

  • are you creating the webpart? or is it a third party webpart or out of the box webpart?
    – Ali Jafer
    Jul 25 '14 at 13:28

Localizing SharePoint Solutions is quite a large topic and there is some great reference material on MSDN.

SPWeb.SupportedUICultures is a method that will tell you which cultures are available in your web. The cultures should correspond with the Optional Language Packs installed.

When I localizing a web part, I often start with creating a resource file for each of the languages I can support. The resource files should contain all of the strings you want available in mutiple lanugages. For your example, given a resource file exists, instead of hardcoding the title name in the web part code, call HttpContext.GetGlobalResourceObject.

  • Thank you for your reply. The problem is that it is a webpart created from the Sharepoint user interface I'm trying to translate programmatically. When i save my site as template site, the labels are the same for all languages ​​(including the title of webparts) in a newer site created with this template. It is possible to translate the title of webparts from the Sharepoint interface for the language enabled, but I would do it by code via the activation of a feature. If it is possible to translate via the Sharepoint interface, i think is possible to do by code, but I can not find how.
    – ALYOS
    Jul 27 '14 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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