How to localize site columns using resource files

Localizing SharePoint 2007 columns consist on

  •  Create resource file for each language.
  •  Add $Resources:<ResourceFilename>,<Resource key name>; to the display name of the site column.

In this article we will create a resource file BOSSContentTypes.fr-FR.resx and a BOSSContentTypes.resx .
The BOSSContentTypes.resx will contain the English labels and the other the French labels of our site columns.

This is a preview of the BOSSContentTypes.fr-FR.resx
the other file contains the same names but English values.

After creating theses two files , deploy them into the 12/Resources  folder.

Now we have to map our Display name with the values in the resource files.

this is a simple snippet from the definition of our content type.


  <Field ID="{79831820-B700-4786-AD10-69F54BED193B}" ShowInDisplayForm="TRUE" ShowInNewForm="TRUE" ShowInEditForm="TRUE" Type="Text" Name="Mission" DisplayName="$Resources:BOSSContentTypes,Mission;"
         StaticName="Mission" Hidden="FALSE" Required="FALSE" Sealed="FALSE" />
  <Field ID="{0F37DF23-F2AF-48ac-8EC4-126220290747}" ShowInDisplayForm="TRUE"
         ShowInNewForm="TRUE" ShowInEditForm="TRUE" Type="Text" Name="Client" DisplayName="$Resources:BOSSContentTypes,Client" StaticName="Client" Hidden="FALSE" Required="FALSE" Sealed="FALSE" />
Now just see what you have done.

Deleting fields inherited from parent content type

When inheriting from existing content type we inherit all fields.
Some fields are some time not necessary so we need to delete theses fields from our Content Type.

This is a sample code of how to remove the unwanted fields.



So the solution is using the < removefieldref > tag and use the GUID of the unwanted field for the ID param.
To get the GUID of the field ,you can access the 12 folder and go to template/features and then to the parent Content type. then open the Schema.xml of the parent content type and find the specific GUID.

Hope this will be useful