Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Wicket will search all resource files with the names equal to the components in your component hierarchy, with your application 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. MyPanel_locale.properties, ..., and then MyPanel.properties
2. MyPage_locale.properties, ..., and then MyPage.properties
3. MyApplication_locale.properties, ..., and then MyApplication.properties (..)

...

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, "MyComponent.properties").getResourceStream().getInputStream()));
  1. Alternatively, you can get the resource from the class loader... this.getClass().getClassLoader().getResouceAsStream("MyComponent.properties");