如何使用隐式本地化与MVCSiteMap? [英] How to use implicit localization with MVCSiteMap?
问题描述
我试图用隐本地化与 MVCSiteMap ,但它不工作。
I'm trying to use implict localization with MVCSiteMap but it's not working.
下面是我的样本的web.sitemap
:
<?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>
我的ResourceKey =产品
在上面的网站地图和相应的 Products.title
在 Web.sitemap.resx
文件, App_GlobalResources文件
文件夹内。按照以上说明:<一href=\"http://msdn.microsoft.com/en-us/library/ms178427(VS.80).aspx\">http://msdn.microsoft.com/en-us/library/ms178427(VS.80).aspx
I have resourceKey="Products"
in the above sitemap and a corresponding Products.title
in Web.sitemap.resx
file, inside App_GlobalResources
folder. Followed these instructions: http://msdn.microsoft.com/en-us/library/ms178427(VS.80).aspx
我是缺少在这里?
本已在变更52831 。
推荐答案
这是在最新版的讨论(在写这篇文章,版本2.2.1的时间)MvcSitemapProvider感谢该项目的所有者,马腾Balliauw!
This was addressed in the latest version (at the time of this writing, version 2.2.1) of MvcSitemapProvider thanks to the project's owner, Maarten Balliauw!
MvcSitemapProvider的隐含定位是作为默认SitemapProvider(几乎相同请参阅如何本地化站点地图数据)。唯一的区别是,而不是设置&LT;站点地图enableLocalization =真正的&GT;
在网站地图文件本身,则必须在网络设置此。配置
文件(<一个href=\"http://mvcsitemap.$c$cplex.com/wikipage?title=Registering%20the%20provider&referringTitle=Home\">as这里)中描述的。
MvcSitemapProvider's implicit localization is almost identical as the default SitemapProvider (see How to: Localize Site-Map Data). The ONLY difference is that instead setting <siteMap enableLocalization="true">
in the sitemap file itself, you must set this in the Web.Config
file (as described here).
这篇关于如何使用隐式本地化与MVCSiteMap?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!