How to use implicit localization with MVCSiteMap?

I am trying to use conflicting localization with MVCSiteMap , but it does not work.

Here is my Web.Sitemap example:

 <?xml version="1.0" encoding="utf-8" ?> <mvcSiteMap xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-2.0" enableLocalization="true"> <mvcSiteMapNode title="Home" controller="Home" action="Index" changeFrequency="Always" updatePriority="Normal"> <mvcSiteMapNode resourceKey="Products" title="Products" controller="Products" action="Index"> <mvcSiteMapNode title="Edit" controller="Products" action="Edit" /> </mvcSiteMapNode> <mvcSiteMapNode title="Categories" controller="Categories" action="Index" /> <mvcSiteMapNode title="Suppliers" controller="Suppliers" action="Index" /> </mvcSiteMapNode> </mvcSiteMap> 

I have resourceKey="Products" in the above sitemap and the corresponding Products.title in Web.sitemap.resx , inside App_GlobalResources . Following these instructions: http://msdn.microsoft.com/en-us/library/ms178427(VS.80).aspx

What am I missing here?

Edit

This was implemented in changeet 52831 .

+6
asp.net-mvc mvcsitemap
source share
2 answers

This was reviewed in the latest version (at the time of this writing, version 2.2.1) MvcSitemapProvider, thanks to the project owner, Maarten Balliauw!

MvcSitemapProvider implicit localization is almost identical by default to SitemapProvider ( see How to: Localize Site Map Data ). The only difference is that instead of setting <siteMap enableLocalization="true"> in the Sitemap itself, you must set this in the Web.Config file ( as described here ).

+6
source share

You need to access the title of the menu item from the resource file in your MvcSiteMapNode

 <mvcSiteMapNode title="$resources:MenuLocaliSations,Dashboard" controller="Dashboard" action="Index" changeFrequency="Always" updatePriority="Normal"> 
+2
source share

All Articles