Trying to get localized content working on Sharepoint Online.

I followed the steps here: http://msdn.microsoft.com/en-us/library/fp179919.aspx#LocalizingAppWeb to create 2 resource files under Solution -> Features.

The structure of my solution right now is

Solution / Features / MyFeature / Resources.resx

What do I do to get a localized MyString through my code behind file (.cs) ? Tried this:

String s = SPUtility.GetLocalizedString("$Resources:MyLabel;", "MyFeature", 1033)

and it didn't work.

Also what do I do to get the same string on my .ascx file ? Tried this:

<%# $Resources:MyLabel,MyFeature %>

and also didn't work

Any clues ?


Try the MSDN article: Localization of Sandboxed Solutions in SharePoint 2010.

The first article describes how to use Satellite Assemblies which you can access through code to localize Web Parts, Event Receivers, ...

The second article describes how to use Feature Resources which you can access in the Feature xml file to localize the feature.

You usually need both approaches as you probably both want to localize how the feature shows as well as your UI and none of the approaches cover both.

  • Out of the two links the second one was the only one that came close and still nothing on how to actually call it.
    – haknick
    May 25 '13 at 4:44
  • 1
    That's because the callable resources is implemented as shown in the first. See expanded answer May 25 '13 at 7:30
  • Ok, much more work than I thought, but seems like the first one will be fine. Thanks
    – haknick
    May 25 '13 at 14:11

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.