In this post we are going to see how we can localize site
columns as well as features.
First let us focus on the site columns.
Create empty SharePoint project.
Now right click on project and click on add mapped folder
and add resource folder.
Now again click on add new item by right clicking on resource
folder and select resource file.
Add these two values
Now add one more resource file for Spanish language. add
es-es to the file name as shown in the image below and add below entries.
Now it's time to create empty element where we would be
adding the site columns.
Right click on project and add empty element.
Add this to the empty element.
Build and deploy the solution
One thing to consider here is that you need to have language
packs installed on the server.
Go to the site settings and site columns. Right now we are
with English language.
Change the language to Spanish
As you can see that column title gets converted to the
Spanish language.
We already have a feature with us which has site columns
element file. Our sole purpose is just to show how features can also be
localized. Now right click the feature and click on add feature resource.
Select Spanish from long list of languages.
And add these texts
and then add this to the web part properties
When you have set the language to English, this is what you
get
Switch language to Spanish.
Let us add one web part. After that open the same LocalizedSiteColumn.resx
under resource folder and add this.
now open the Spanish resource file and add this
Now open the web part file and change the title and
description to point it to resource file.
This will also localize the web parts. I hope this helps.
No comments:
Post a Comment