vb.Net 中是否可以对资源文件进行优先级排序
我有一个 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 技术交流群。

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