You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Manuel Thurn <ma...@isogmbh.de> on 2006/06/29 17:54:36 UTC

DatePicker Localization

Hello all,

I want to localize a DatePicker. Instead of
<binding name="translator" value="translator:date,pattern=dd MM yyyy"/>
I would like Tapestry to get a key value of a message catalog (.properties
files): 
<binding name="translator" value="translator:date,pattern[%date-key]"/>

But the nice validator syntax with the % and the key enclosed in brackets
doesn't work for the date translator.

What would be the best way to output the date of a DatePicker with a
localized date pattern?

Thanks in advance,
Manuel


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


RE: DatePicker Localization

Posted by Manuel Thurn <ma...@isogmbh.de>.
Hi!

I found the answer myself:

<bean name="dateTranslator"
class="org.apache.tapestry.form.translator.DateTranslator">
   	<set name="pattern" value="message:date-pattern"/>
</bean>

<component id="validFrom" type="DatePicker">
	<binding name="value" value="validFrom"/>
	<binding name="translator" value="bean:dateTranslator"/>
</component>

That way I can use the message key. :-)

Manuel


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