管理国际化检票口应用程序 [英] Administrating internationalized wicket applications

查看:68
本文介绍了管理国际化检票口应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有很好/正确的方法来维护/管理Wicket应用程序的国际化?

Is there a good/right way to maintain/administrate the internationalization of a Wicket application?

目前,有几个* .properties-files包含翻译,就像在Wicket中一样.您可以在运行时访问它们并更改值,以便在不重新启动应用程序的情况下进行更改吗?

At the moment there are several *.properties-files with the translations in it just as you do it in Wicket. Can you access these on runtime and change the values so that the changes take place without restarting the app?

(另一种方法是将值存储在数据库中,但我现在暂时将其保留.)

(Another way would be to store the values in a database but I just leave that for now.)

推荐答案

您可以编写自己的

You can write your own implementation of IStringResourceLoader and register it with your application as follows:

getApplication().getResourceSettings().addStringResourceLoader(  
                                                     new CustomResourceLoader());

您的资源加载器应从WAR文件之外的某个位置获取资源,以便管理员可以按照Aaron Digulla的建议对其进行修改.

Your resource loader should fetch the resources from some place outside of the WAR file so it can be modified by administrators as suggested by Aaron Digulla.

要让Wicket在运行时获取修改,您必须像这样调整资源设置:

To get Wicket to pick up modifications at runtime you have to adapt your resource settings like this:

getApplication().getResourceSettings().setResourcePollFrequency( 
                                                           Duration.seconds(1));

这篇关于管理国际化检票口应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆