SPUtility.GetLocalizedString

Sometimes it can be useful to get resources from the Resources folder in the MOSS 12 hive in your C# code. If you want to get a resource from a resource file located in 12/Resources folder at runtime you can use the GetLocalizedString method of the SPUtility class, like so:


SPUtility.GetLocalizedString("$Resources: dcl_schema_view_allitems", "core", 1053);

The above example will fetch the resource corresponding to “dcl_schema_view_allitems” from the core.resx file with 1053 (Swedish) LCID. The value returned from the above code is (from core.sv-se.resx): “Alla objekt”

  1. #1 by dotNetFollower on September 1, 2011 - 20:26

    Veri nice article. In my blog I have similar article on how to use SPUtility.GetLocalizedString – http://dotnetfollower.com/wordpress/2011/05/the-usage-of-sputility-getlocalizedstring/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: