Localization By Message Catalog Page
This page demonstrates a couple of Tapestry's facilities for achieving localization,
including "component message catalogs".
- Dates are easily localised because Insert takes a format parameter. We give it a fresh Format created with current locale.
- Static text can be replaced by a span tag holding a message key,
which is used to look up messages in a "component message catalog",
which is basically a set of properties files sharing the same root name as the page.
There are 2 such properties files for this page - a French language one and a catch-all - which are searched with each message key:
- LocalizationByMessageCatalogPage_fr.properties is searched first if your locale language is set to French.
- LocalizationByMessageCatalogPage.properties is searched if your locale language is NOT French or the key was not in the French file.
Actually, if the message key is not found in either then Tapestry searches the jumpstart-max*.properties files in WEB-INF, so that's where you put global text.
To Login