Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

Localization of visual webpart

$
0
0

I have two visual webparts, A and B in my project.I added a sharepoint mapped folder to Resources ({SharePointRoot}\Resources). In this I added a resource file, say MyResource.resx. In this I added the strings for feature title,feature description,title and description for the .webpart file and some strings that will be used in the ascx of the visual webpart.I then copied and pasted MyResource.resx as MyResource.fr-FR.resx and changed the strings appropriately to french language.Both the webparts are in the same feature and are making use of lists present in a different feature to display data.So in the properties of the Feature containing the webparts, under "Default Resource File", I put my resource file name, i.e.MyResource.In the .webpart files, I am calling resource as

$Resources:MyResource,TasksTitle and $Resources:MyResource,TasksDescription.i.e.<property name="Title" type="string">$Resources:MyResource,TasksTitle</property><property name="Description" type="string">$Resources:MyResource,TasksDescription</property>

In the ascx, I am calling it in a few places, like

<div>$Resources:AssignedTasks</div><asp:LinkButton ID="lnkDelete" runat="server" Text="$Resources:DeleteLink" CommandName="Delete" ForeColor="Brown"/>

I deploy the solution,restart iis. When I check under SiteCollectionFeature, I can see that when I change the language, it is working correctly for the feature title and descrioption.
But when I change the language to french and goto the webpart gallery and check the title and description, it shows the values for the default language instead of french.
When I check the webpart on the page, I can see that irrespective of the language I select, it shows as $Resources:AssignedTasks and $Resources:DeleteLink .When I checked14\Resources folder, I saw both the resource files were copied.Kindly advise what I need to do so that the title and description of webpart as well as the content of ascx gets translated?


Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>