This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • I18n and resource bundles
Skip to end of metadata
Go to start of metadata

Wicket will search all resource files with the names equal to the components in your component hierarchy, starting from application level at top to component defaults as a last resort.

So when Wickets wants to look up a message used in MyPanel, where MyPanel is contained within MyPage, and the application is called MyApplication, Wicket will look in:
1., ..., and then (..)
2., ..., and then
3., ..., and then

Actually, it even goes two steps further. Wicket will also look at property files for the base classes of MyPanel, MyPage and MyApplication.
When MyPanel inherites directly from Panel, MyPage directly from Page and MyApplication directly from Application, Wicket will look in:
1., ..., and (..)
2., ..., and then (..)
3., ..., and then
4., ..., and then
5., ..., and then
6., ..., and finally

In conclusion: you can use for site wide messages and override these in any of the other properties files.

The second extension of this is styles and variants. Styles and variants are not suitable for i18n.

Load resources dynamically for a component

  1. Properties.load(PackageResource.get(MyComponent.class, "").getResourceStream().getInputStream()));
  1. Alternatively, you can get the resource from the class loader... this.getClass().getClassLoader().getResouceAsStream("");
  • No labels