asp.net mvc 本地化。视图是本地化的,外部 DLL 中的嵌入资源不是

发布于 2024-11-30 14:36:42 字数 416 浏览 2 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文