Did you know: provisioning AppGlobalResources in SharePoint 2010

, , , ,

Developing localized solutions on the SharePoint 2007 platform wasn’t as straight-forward as we wanted it to be. First of all you had to make your code support globalization and then you had to provision the localized Resource files to your Web Application. As SharePoint 2007 didn’t provide any mechanism to do that, you had to use custom Timer Jobs to get this done correctly. Luckily this situation has changed with SharePoint 2010 which introduces the new App_GlobalResourceFile element in the Solution Manifest which makes it possible to declaratively deploy Resource files in a structured and repeatable fashion.

Provisioning Resource files to your Web Application is very straight forward. All you have to do is to include your Resource file in the Solution using the App_GlobalResourceFile element, for example:

<Solution>
  <ApplicationResourceFiles>
    <App_GlobalResourceFile Location="MyResource.resx"/>
  </ApplicationResourceFiles>
</Solution>

Using the snippet above will copy your resource file to the Web Application’s IIS directory\App_GlobalResources during the deployment process.

Provisioning the Resource files in SharePoint 2010 is even easier if you’re using the new Visual Studio 2010 SharePoint Developer Tools. In such case all you have to do is to add an Empty Element SharePoint Project Item to your project and underneath it add your Resource file. As soon as you do that, the Resource file will allow you set additional property called Deployment Type. In order to deploy the Resource file to App_GlobalResources you have to set the value of the Deployment Type property to AppGlobalResource.

Resource file selected in the Solution Explorer window. 


Possibly related posts

7 Responses to “Did you know: provisioning AppGlobalResources in SharePoint 2010”

  1. Tweets die vermelden Did you know: provisioning AppGlobalResources in SharePoint 2010 - Waldek Mastykarz -- Topsy.com Says:

    [...] Dit blogartikel was vermeld op Twitter door Waldek Mastykarz, Robin Meuré. Robin Meuré heeft gezegd: RT @waldekm: New post: 'Did you know: provisioning AppGlobalResources in SharePoint 2010' http://tinyurl.com/3a9tqf8 #SharePoint [...]

  2. Sorin Says:

    How about SharePoint farm environments with multiple front-ends, the resource files are automatically provisioned on all front-ends?

  3. Waldek Mastykarz Says:

    @Sorin: although I haven't tried it myself, I'd say it will be, because that's the way deployment through WSP works. The same applies to deploying assemblies to BIN through WSP.

  4. Gennadiy Says:

    Thank you Waldek. Short and clear!

  5. 3 ways to localize SharePoint XSLT files « Shades of SharePoint Says:

    [...] the IIS web application directory. For details on achieving this, you can refer to the article Did you know: provisioning AppGlobalResources in SharePoint 2010 by Waldek [...]

  6. Qasem Says:

    Hi Waldek, I hope you are doing well (f)
    I jsut need to know is it posible to use Resource file with Calculated coulmn which i tring to create a site column using VS 2010 to create this calculated coulmn for display the month in Arabic language , see this is my coulmn schema

    =CHOOSE(MONTH(PublishDate),"$Resources:News,Jan;","$Resources:News,Feb;","$Resources:News,Mar;","$Resources:News,Apr;","$Resources:News,May;","$Resources:News,Jun;","$Resources:News,Jul;","$Resources:News,Aug;","$Resources:News,Sep;","$Resources:News,Oct;","$Resources:News,Nov;","$Resources:News,Dec;")

    and this is the result if you clik on the column setting

    =CHOOSE(MONTH([تاريخ نشر الخبر]);"$Resources:News,Jan;";"$Resources:News,Feb;";"$Resources:News,Mar;";"$Resources:News,Apr;";"$Resources:News,May;";"$Resources:News,Jun;";"$Resources:News,Jul;";"$Resources:News,Aug;";"$Resources:News,Sep;";"$Resources:News,Oct;";"$Resources:News,Nov;";"$Resources:News,Dec;")

    any help will be appreciated

    Thnaks in advance

  7. Qasem Says:

    To Followup :)

Leave a Reply

Security Code:

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS
Copyright © 2007 - 2012 Waldek Mastykarz

Creative Commons License