补充资源包
目前,我的 GUI 中的所有设置项都有一个资源包。我的应用程序允许添加新组件(如自定义按钮(不是新的摆动组件))[可以具有本地化文本]。
包含用户创建的按钮的本地化文本的最佳方法是什么?
现有按钮的翻译设置在相应的资源包(已部署的 JAR 内部)中。
有没有办法用内部资源包补充外部资源包?
我意识到我可以围绕现有功能编写一个包装器来包含此功能,但我想知道是否有人以不同的方式解决了这个问题。
I currently have a Resource Bundle for all of the set items in my GUI. My application allows for the additions of new components (as in customized buttons (not new swing components)) [which can have localized texts].
What is the best way of including the localized texts for the user created buttons.
The existing buttons have their translations set in the respective resource bundle (inside of the deployed JAR).
s there an way to supplement external resource bundles with internal ones?
I realize that I can write a wrapper around the existing functionality to include this, but I was wondering if someone has solved this problem in a different manner.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于动态 UI,恐怕唯一现实的选择是使用数据库。当然,没有什么可以阻止您实现从数据库读取资源的 ResourceBundle 子类 - 您可以通过这种方式实现访问资源的统一方式。
而且数据库本身不一定是消耗资源的怪物,您可能需要使用 Apache Derby或H2。
In case of dynamic UI, I am afraid the only realistic option is to use the database. Of course nothing stops you from implementing ResourceBundle child class that would read resources from the database – you may achieve uniform way of accessing resources that way.
And the database itself doesn't have to be resource-eating monster, you might want to use Apache Derby or H2.