Re: Localization in Services

2009-02-09 Thread Nicolas Charles
Blower, Andy wrote: Not sure how generally useful that would be, but it would solve the problem in an easy way. Thinking some more about this, would it not be easier to simply pass the messages from the page/component event handler method into the service method that's called to send the

Re: Localization in Services

2009-02-07 Thread Howard Lewis Ship
called to send the email? -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: 06 February 2009 21:26 To: Tapestry users Subject: Re: Localization in Services Which Messages resource would it inject? I suppose we could add the application's Messages object

Re: Localization in Services

2009-02-06 Thread Tapestry Infodea
You can use the ValidationMessagesSource and ThreadLocale services: ValidationMessagesSource validationMessagesSource; ThreadLocale threadLocale; Messages messages = validationMessagesSource.getValidationMessages(threadLocale.getLocale()); Roberto. Nicolas Charles ha scritto: Hello

Re: Localization in Services

2009-02-06 Thread Tapestry Infodea
I've forgetten a piece of code, you must contribute the ValidationMessagesSource in your AppModule: public void contributeValidationMessagesSource(OrderedConfigurationString configuration) { configuration.add(myprop, it/infodea/app/internal/myprop); } and define myprop.properties in

Re: Localization in Services

2009-02-06 Thread Nicolas Charles
Thanks for the tip Roberto, but I didn't succeed into adding the app.properties (or just i can't get the key, i don't know) And it feels strange to use the ValidationMessage for a standart message Nick Tapestry Infodea wrote: I've forgetten a piece of code, you must contribute the

Re: Localization in Services

2009-02-06 Thread Howard Lewis Ship
I would go a different route. Using the ComponentSource service, you can get any page in the application as a Component instance. From that you can get the ComponentResources and from that, the Messages object. Just be aware of the lifecycle: once you boost a Messages instance out of the

RE: Localization in Services

2009-02-06 Thread Blower, Andy
[mailto:hls...@gmail.com] Sent: 06 February 2009 17:03 To: Tapestry users Subject: Re: Localization in Services I would go a different route. Using the ComponentSource service, you can get any page in the application as a Component instance. From that you can get the ComponentResources and from

Re: Localization in Services

2009-02-06 Thread Howard Lewis Ship
: Localization in Services I would go a different route. Using the ComponentSource service, you can get any page in the application as a Component instance. From that you can get the ComponentResources and from that, the Messages object. Just be aware of the lifecycle: once you boost a Messages

RE: Localization in Services

2009-02-06 Thread Blower, Andy
Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: 06 February 2009 21:26 To: Tapestry users Subject: Re: Localization in Services Which Messages resource would it inject? I suppose we could add the application's Messages object as an injectable value. On Fri, Feb 6