从其他存储机制存储和加载国际化资源

发布于 2024-12-13 03:52:12 字数 655 浏览 0 评论 0原文

我们有一个 Windows 窗体应用程序的功能请求,我们希望让系统管理员能够在编译和部署应用程序后重新定义应用程序字符串和其他国际化值(控制宽度/布局等)。主要用例是客户重新定义一些标签字符串等以更好地适应他们的业务流程,因此我们不会完全重新定义屏幕 - 更多只是对标签和按钮宽度等进行细微调整。我们有一个同步应用程序中已经存在图层,因此管理员可以从 Web 门户进行 UI 调整,并将设置存储在数据库中。下次客户端应用程序与服务器同步时,它将下载 UI 设置(使用 SQL CE 数据库或文件等),然后将这些设置应用到视图(可能在重新启动后)。实际资源键/值的导出和导入过程不在这个问题的范围内...

所有视图都以通常的 Windows 窗体方式编码,但所有视图都是国际化的(使用 Localized=True 标志),我们目前使用 .resx 机制将应用程序国际化为 4 或 5 种语言。

我的问题是 - 是否可以使用 .NET ResourceManager 从应用程序集中嵌入资源文件以外的其他来源加载资源?例如,当应用程序请求资源时,从 SQL CE 数据库查找它,而不是从特定区域性程序集的嵌入式资源文件中查找?

我知道这个功能和实现可能有很多问题,但我们目前并不担心这些问题。此时我们也不担心让这个超级用户友好 - 我只是想知道是否可以轻松地更换资源的后备存储机制。

如果有人有的话,我也有兴趣了解完全不同的实现选项。

We have a feature request for a Windows Forms application where we want to give the sys admin the ability to redefine application strings and other internationalizable values (control widths/placement/etc.) after the application has been compiled and deployed. The main use case is for the customer to redefine some of the label strings etc to better fit their business processes, so we're not looking at completely redefining screens - more just minor tweaks to labels and button widths, etc. We have a synchronization layer already in the application, so the idea would be for the admin to do the UI tweaks from a web portal, and the settings would be stored in a database. The next time the client application syncs with the server, it would download the UI settings (using a SQL CE database or files, etc.), then apply those settings to the views (maybe after a restart). The export and import process of the actual resource keys/values is not in the scope of this question...

All the views are coded in the usual Windows Forms way, but all the views are internationalized (using the Localizable=True flag), and we currently use the .resx mechansims to internationalize the app to 4 or 5 languages.

My question is - is it possible using the .NET ResourceManager to load resources from other sources than the embedded resource files in the application assemblies? For example, when the application requests a resource, look it up from a SQL CE database rather than the embedded resource files for the culture-specific assembly?

I know this feature and implementation might have a good number of gotchas, but we're not worried about those at this point. We're also not worried about making this super-user friendly at this point - I just want to know if it's possible to easily swap out the backing storage mechanism for resources.

I'm also interested in learning about completely different implementation options for this if anyone has any.

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

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

发布评论

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