asp.net mvc 本地化。视图是本地化的,外部 DLL 中的嵌入资源不是
我在 ASP.NET MVC 中遇到了一个非常奇怪的本地化问题。让我概述一下我的项目,因为它并不是那么简单。
我的网站有一个 TRUNK 版本。该网站使用两种本地化技术。第一个是从 App_LocalResources 加载视图中的资源。第二种技术是从 DLL(项目引用)中的嵌入资源加载资源。
在一个视图中,我显示了一些从视图本地化的标签,并且还通过 AJAX/JSON 加载了一些标签。该操作从引用的类项目 (DLL) 中的嵌入资源获取本地化数据。实际上,在 TRUNK 中,这种方法效果很好。
现在的问题是:我有一个分支,它没有对嵌入资源的项目引用,但有对已编译的 DLL(副本)的引用。在 BRANCH 中,本地化仅适用于视图,不适用于仅返回默认区域设置的 AJAX/JSON 调用。
有什么问题吗?如果重新分发 DLL,是否必须对其进行设置?!
I have encountered a very strange issue with localization in ASP.NET MVC. Let me outline my projects since it is not that straight forward.
I have a TRUNK version of my website. The website uses two localization techniques. The first one is to load resources within the views from App_LocalResources. The second technique is to load resources from embedded resources in DLLs (project references).
On one view I show some lables which are localized from the view and I also load some labels via AJAX/JSON. The Action gets the localized data from an embedded resource in a referenced class project (DLL). Actually, in TRUNK, this works pretty well.
Now the Problem: I have a BRANCH which does not have a project reference to the embedded resource but a reference to a compiled DLL (copy). In the BRANCH the localization only works for the View, not for the AJAX/JSON call which simply returns the default locale.
What can be wrong? Do you have to make an settings on the DLLs if you redistribute them?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论