On Tue, 11 Aug 2015 03:29:13 -0300, Nathan Quirynen <nat...@pensionarchitects.be> wrote:

So I want to have the usual properties file for the page and besides
this for each possible value of a property an extra properties files in
which specific localized messages are located.

So for example an Index page it can have the following:

- Index.properties
- Index_en.properties
- Index_120.properties
- Index_120_en.properties
- Index_130.properties
- Index_130_en.properties
- ...


But when the page loads the value of the property is for example 120
then Index.properties and Index_120.properties wil have to be used.

I hope it is more clear now. So i need to load the messages catalogs
depending on the property value.

I'd try this: @Inject ThreadLocale threadLocale, then in your page's onActivate() method call threadLocale(new Locale("[current language code]", [property value]), then use ${message:xxx} or @Inject Messages as usual. You'd need to revert the naming convention: instead of Index_130_en.properties, Index_en_130.properties. The idea is using locale country or even variant, as supported in Locale(String language, String country) and Locale(String language, String country, String variant) constructors of java.util.Locale.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to