the wicket internationalization example available has the following file structure
HomePage.java
HomePage.html
HomePage.properties
WicketApplication.java
HomePage_nl.properties
Now when creating a project with multiple HTML pages, for example i have
HomePage.html and Login.html, is there a way that i can save all key-value pair in single property for a particular language
or
i will have to have to create all these files
HomePage.properties
HomePage_nl.properties
Login.properties
Login_nl.properties
Wicket will try to find message resources using the following rules:
Wicket will try to find the message starting from the
Pageand drilling down to the specificComponentthrough the component hierarchy of thePage. Notice this is a top-down search.When a message is not found in the component hierarchy, it will be looked for in the
Applicationclass.The lookup for a resource in every class works in the following way :
Localised searches appending the locale to the file name (
Login_nl.properties, thenLogin.properties), just like Java’sResourceBundles do.Down-top through the class hierarchy. That means that if a resource is not found in a class, it will be searched in its superclasses all the way until it hits
java.lang.Object.So, in your specific case, if
Loginis aPanelinsideHomePage, you can just define the resources inHomePage(_nl).properties. Also, if there are specific application-wide messages, remember that you can define them inWicketApplication(_nl).properties.You might find the following Wicket wiki page : Everything about Wicket internationalization useful, it elaborates on this matter.