C# 卫星程序集? 我需要链接默认文化资源吗

发布于 2024-07-09 23:44:50 字数 371 浏览 7 评论 0原文

我们希望使用附属程序集来包含各种依赖于语言环境的资源文件。

问题是......我们需要链接默认区域性吗?

我们有一个单独的项目,其中包含我们所有不同的文化资源文件。 如下所示,我们的项目里面有两个资源文件。

ProjRES

  • Resource.resx
  • Resource.it-IT.resx

我假设“Resource.resx”将充当默认区域性,如果选择意大利区域性,应用程序将采用 it-IT 资源文件。

我们需要做什么才能让应用程序和项目的其余部分访问资源文件。 我们如何设置资源文件的命名空间以便能够引用它们。

任何帮助是极大的赞赏。

We would like to employ satellite assemblies to contain various locale dependent resource files.

Question is ... do we need to link the default culture?

We have a separate project which will contain all of our different culture resource files. As is shown below, we have the project with two resource files inside of it.

ProjRES

  • Resource.resx
  • Resource.it-IT.resx

I am assuming that the "Resource.resx" will act as the default culture and if the Italian culture is selected, the application will adopt the it-IT resource file.

What do we need to do in order to get the rest of the application and projects to access the resource files. How do we set the namespaces for the resource files in order to be able to reference them.

Any help is greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情深如许 2024-07-16 23:44:50

基本上,

如果操作系统使用的当前区域性与您已发布的特定区域性相匹配,则将使用该区域性;如果当前区域性与您已发布的任何区域性都不匹配,则它将使用中性区域性。

在最简单的情况下,您只需要在部署中包含任何本地化的 dll,一切都会好起来的。

当您使用资源管理器时,我认为您还可以明确传递您想要使用的区域性,并且运行时将搜索匹配的资源 - 当 ASP.Net 站点的用户可能具有与运行该站点的计算机不同的特定文化首选项时,这会更好。

http://msdn.microsoft.com/en-us/magazine/cc163609。 aspx 似乎是一个很好的起点。

Basically,

if the current culture that the OS is using matches a certain culture that you've shipped, it will be used, if the current culture matches none of the cultures you've shipped, it will use the neutral culture.

In the most simplistic cases, you'll just need to include any of the localized dlls with the deployment and all will be fine..

When you're using resource managers, I think you can also pass in which culture you want to use explicitly, and the runtime will search for resources that match - this is better when a user of an ASP.Net site might have a certain culture preference that is different from that of the machine that the site is running on.

http://msdn.microsoft.com/en-us/magazine/cc163609.aspx seems to be a good starting point.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文