Localization By Localized Template Page
This page demonstrates a couple of Tapestry's facilities for achieving
localization, including "localized templates".
- Dates are easily localised because the Insert component has a format parameter.
We give it a fresh Format created with current locale.
- The entire page can be localized by providing an HTML template per locale.
In this example we use:
- LocalizationByLocalizedTemplatePage_fr.html is used if your locale language is set to French.
- LocalizationByLocalizedTemplatePage.html is used if your locale language is NOT French.
- Assets are easily localised. In this example we have 4 flags:
- flag_fr.png is used if your locale language is set to French.
- flag_en_US.png is used if your locale is set to English (US).
- flag_en_GB.png is used if your locale is set to English (UK).
- flag.png is a catch-all, used when your locale does not match the 3 above. It is a tiny clear dot.
Note that the "message catalog" and "localized template" techniques can used together on any page!
To Login