SharePoint: using OOTB translations

In SharePoint there are already a lot of translated strings, that you can find in the resx files in the folder C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\Resources.

You can incorporate them in your resource files in the form $Resources:StringID;. For example you can use:

   Url="$Resources:core,Document;"

To access them from C# code, you can use the method SPUtility.GetLocalizedString.

For example, to retrieve the name of the Document content type, it is possible to use the following line:

   string documentCTname = SPUtility.GetLocalizedString("$Resources:Document", "core", web.Language);

Add comment

Loading