You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Henrik Schlanbusch <he...@enovate.no> on 2010/08/11 09:09:08 UTC

Contribute custom Messages for localization

Hi all

We have a Message service that we used when our system
was implemented in T4. The messages will request localized
strings from file and override the string with values
from the database if they have been overridden there.

I cannot find anything in the T5 literature on how to 
provide custom Message implementations, so that we can 
continue to use this strategy for our app.

Henrik von Schlanbusch


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


Re: Contribute custom Messages for localization

Posted by Christophe Cordenier <ch...@gmail.com>.
Hi !

Tapestry 5 has a built-in mechanism to decorate/override services

http://tapestry.apache.org/tapestry5/guide/alias.html

As far a i remember, the service in charge of getting messages in page is
ComponentMessagesSource

http://github.com/apache/tapestry5/blob/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentMessagesSourceImpl.java

Also, here is a sample of what we did in Wooki to obtain localized messages
in services instances

http://github.com/spreadthesource/wooki/blob/master/src/main/java/com/wooki/services/ServicesMessagesImpl.java

I guess you can easily add a custom DatabaseMessagesBundle in the hierarchy,
also don't forget cacheing strategy

HTH

2010/8/11 Henrik Schlanbusch <he...@enovate.no>

> Hi all
>
> We have a Message service that we used when our system
> was implemented in T4. The messages will request localized
> strings from file and override the string with values
> from the database if they have been overridden there.
>
> I cannot find anything in the T5 literature on how to
> provide custom Message implementations, so that we can
> continue to use this strategy for our app.
>
> Henrik von Schlanbusch
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com