已部署的 ASP.Net 站点中的可编辑资源文件
显然,我对 .resx 文件的理解是有缺陷的 - 我假设(未经测试)它们被部署为 XML,以便稍后保持可编辑 - 显然,这是不正确的。因此,我需要在我们公司的 Web 应用程序中填充标签和格式字符串,希望这里有人可以为我指明正确的方向。
我正在寻找一种可以支持多种语言并且可以由系统管理员稍后进行编辑的解决方案。对于第一个要求,resx 文件可以完美工作 - 如果 UI 区域性发生更改,则使用适当的资源,或者如果没有区域性特定资源可用,则默认为顶级资源。不幸的是,如果公司 A 希望资源字符串为“帐号”,而公司 B 希望同一字符串为“帐户 ID”,我们没有好的方法来支持这一点 - 我们不想编译一个不同的字符串每个公司的网站版本,只需更改一些资源字符串 - 理想情况下,这些字符串可以简单地由公司的技术人员在部署后设置。
有没有一个可以在这里使用的框架?或者也许是使用 resx 文件来解决问题的不同方法?
Apparently, my understanding of .resx files was flawed - I had assumed (without testing) that they were deployed as XML so as to remain editable at a later time - clearly, this is incorrect. So, I'm left with a gap I need to fill for the labels and format strings in our company's web application, hopefully someone here can point me in the right direction.
I'm looking for a solution that can support multiple languages, and can be edited by a system administrator at a later date. For the first requirement, resx files work perfectly - if the UI culture is changed, the appropriate resource is used, or it defaults to the top level resource if no culture specific resource is available. Unfortunately, if company A wants a resource string to be "Account Number", and company B wants that same string to be "Account ID", we have no good way to support this - we don't want to have to compile a different version of the web site for each company, just to change a few resource strings - ideally, those strings could simply be set by the company's tech person after deployment.
Is there a framework out there that will be of use here? Or perhaps a different way to approach the problem using resx files?'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确实不能将 resx 文件用于预编译的解决方案。
有两个选项:
部署站点的未编译版本。
实施数据库解决方案,并创建用于更新文本的管理区域,以便用户可以登录并进行更改。您将能够维护预编译的代码。
You really can't use resx files for your pre-compiled solution.
There are two options:
Deploy an uncompiled version of your site.
Implement a database solution, and create an administrative area for updating the text, so a user may log in and make changes. You would be able to maintain your precompiled code.