Sorry, I was wrong... you can do it!!
AppModule.java
---
public void contributeTranslatorAlternatesSource(MappedConfiguration config) {
configuration.add("fileSize", new FileSizeTranslator());
}
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Named-transl
I realise that it's a hack but unfortunately tapestry is using
MappedConfiguration so that there can only be one
translator mapped per class.
Perhaps this is another argument to consider adding a
MultiMappedConfiguration
http://tapestry.1045711.n5.nabble.com/MultiMapConfiguration-td5714003.html
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 wrote:
> This might work:
>
> TML:
>
>
> JAVA:
> @InjectComponent
>
This might work:
TML:
JAVA:
@InjectComponent
private Field myField;
@Environmental
private FormSupport formSupport;
@Inject
private Message messages;
public FieldTranslator getMyTranslator() {
Translator translator = new FileSizeTranslator(...);
MessageFormatter formatter = messages.ge