R – SharePoint / WSS: How to localize a feature

mosssharepointwss

I have a WSP package that contains some features.

I need to be able to localize the following in the features:

  1. Site Column Field Display Names
  2. Description of Content Types
  3. List Instance Description
  4. List Schema Fields

I am looking for a method to achieve all of this as easily as possible.

Best Answer

In short, create a Resources folder inside of your feature folder, then add a text file to it, name it Resources.en-US.txt rename the file from .txt to .resx.

I use this roundabout way because I don't want the .designer.cs file and i don't want the schema part in my resx file. Which is what you get when you add a normal Resources file.

Open the resx file using the xml editor (right click -> open with) and add your properties in the following format:

<root>
  <data name="ANYNAME">
    <value>Some value</value>
  </data>
  <data name="ANOTHERNAME">
    <value>Some value</value>
  </data>
</root>

now you can use $Resources:ANYNAME etc. in your feature.xml i.e.

<feature Title="$Resources:ANYNAME" Description="$Resources:ANOTHERNAME" />
Related Topic