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.

Enregistrer un commentaire