Sunday, April 19, 2009

Using resources in sharepoint for Globalization and Localization

Scenario:
I was working on a product offline and had to read resources to support multiple language.

Solution:
SPUtility has in build support for this.The resource file should get deployed to the 12\Resources directory. In my case I created one called “customAppResources.resx”.

Code:

uint language = currentWeb != null ? currentWeb.Language : 1033;

string returnValue = SPUtility.GetLocalizedString("$Resources:customApp,StringToRead", "customAppResources", language);
Article:
Resouces , http://msdn.microsoft.com/en-us/library/c6zyy3s9.aspx

0 comments: