vb.Net 中是否可以对资源文件进行优先级排序

发布于 2024-11-30 14:56:40 字数 507 浏览 6 评论 0原文

我有一个 vb.Net 网站,旨在处理多种语言。所有文本内容都保存在全局资源文件中:Resource.resx

还有其他资源文件设置,例如; Resource.nl-NL.resx & Resource.es-ES.resx 包含默认文化(英语)以外的文化内容。

当应用程序运行时,.Net 会根据用户文化从正确的资源文件中提取所有文本。如果该区域性的资源不存在,则使用默认 Resource.resx 文件中保存的数据。这一切都按其应有的方式进行。

我的问题是,现在,有人要求我当特定类型的用户(无论文化如何)查看网站时,某些网站文本会有所不同。所以现在我发现自己有另一个资源文件 Resource2.resx,它也可以有替代文化; Resource2.nl-NL.resx & Resource2.es-ES.resx

有没有办法将站点设置为首先使用 Resource2.resx,然后在密钥不存在时使用 Resource.resx?我可以通过在后面的代码中手动指定每个控件的文本来做到这一点,但这很痛苦......

I have a vb.Net website that is set up to handle multiple languages. All the text content is held in the global resource file: Resource.resx

There are other resource files set up such as; Resource.nl-NL.resx & Resource.es-ES.resx that contain the content for cultures other than the default: English.

When the application runs .Net kindly pulls all the text from the correct resource file, according to the users culture. If the resource for that culture does not exist, the data held in the default Resource.resx file is used. This all works as it should.

My problem is that now, I have been asked that some of the website text be different when the website is viewed by a specific type of user (regardless of culture). So now I find myself with another recourse file Resource2.resx, which could also have alternate cultures; Resource2.nl-NL.resx & Resource2.es-ES.resx

Is there a way to set up the site to first use Resource2.resx, but then fall back on Resource.resx if the key does not exist? I can do this by specifying the text for each control manually in the code behind, but it's a pain...

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

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

发布评论

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