Localizing CoreSearchResults Web Part with XSLT


in ,

I recently had to create a custom formatting via XSLT for SharePoint CoreSearchResults Web Part. This is not very complicated, and has been around since SharePoint 2007 (Customizing Enterprise Search Results). This time, however, we had to localize the XSLT transformation so that it displays different labels based on SharePoint UI language selected.

A colleague of mine, Vinko Bedek, managed to solve this, here is what you need to do:

  • Resource file (e.g. YourResourceFileName.resx) must be placed in inetpub directory e.g. C:\inetpub\wwwroot\wss\VirtualDirectories\80\App_GlobalResources
  • Parameter binding must be created for each resource you plan to use e.g.
<ParameterBinding Name="ParameterName" Location="Resource(YourResourceFileName,NameOfResourceToBeExtracted)">
  • Use the following syntax to display the value:
<xsl:value-of select="$ParameterName"/>