Lance, this approach definitely works; however, I was looking for a way to declare this field translator somewhere globally as I use it in a few different places.
Cheers, Alex K On Thu, Aug 23, 2012 at 11:20 AM, Lance Java <lance.j...@googlemail.com>wrote: > This might work: > > TML: > <t:textField t:id="myField" value="..." translate="prop:myTranslator" /> > > JAVA: > @InjectComponent > private Field myField; > > @Environmental > private FormSupport formSupport; > > @Inject > private Message messages; > > public FieldTranslator getMyTranslator() { > Translator translator = new FileSizeTranslator(...); > MessageFormatter formatter = messages.getFormatter(translator.getName() > + > "-message"); > return new FieldTranslatorImpl(myField, translator, formatter, > formSupport); > } > > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Named-translators-tp5715756p5715764.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >