You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Yohan Yudanara <yo...@gmail.com> on 2012/09/06 15:34:09 UTC

messages.get always use default localization on "onValidate" and "onSuccess" ?

Hi..

I'm using T 5.3.4,

@Inject
private Messages messages;

messages.get("key") return string from correct local properties file when
called from "setupRender" and "afterRender".
But, why messages.get("key") always return string from default local
properties when called from "onValidate" and "onSuccess" ?
Am I doing something wrong or is this the expected behavior ?

Thanks in advance...

Re: messages.get always use default localization on "onValidate" and "onSuccess" ?

Posted by Yohan Yudanara <yo...@gmail.com>.
Hi..

Thank a lot for your reply. Tapestry is great and powerful framework..

I've resolved my problem.
The weird behavior caused by my mistake to set ThreadLocale instead
of PersistentLocale, when I set locale programatically.
I also incorrectly override LocalizationSetter service, which cause weird
behaviour.

Now everything works fine..

Best regards,
Yohan Yudanara




On Thu, Sep 6, 2012 at 9:32 PM, Howard Lewis Ship <hl...@gmail.com> wrote:

> I suspect your issue is not what you expect. The same Messages
> instance is used in all cases, regardless of what method it is invoked
> from.
>
> I'm sure it's an issue of what keys you are accessing, and what
> .properties file contains each key/value pair.
>
> People often seem to get confused, thinking that the search path for a
> component includes the containing page/component's catalog. It does
> not.
>
> On Thu, Sep 6, 2012 at 6:34 AM, Yohan Yudanara <yo...@gmail.com>
> wrote:
> > Hi..
> >
> > I'm using T 5.3.4,
> >
> > @Inject
> > private Messages messages;
> >
> > messages.get("key") return string from correct local properties file when
> > called from "setupRender" and "afterRender".
> > But, why messages.get("key") always return string from default local
> > properties when called from "onValidate" and "onSuccess" ?
> > Am I doing something wrong or is this the expected behavior ?
> >
> > Thanks in advance...
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: messages.get always use default localization on "onValidate" and "onSuccess" ?

Posted by Howard Lewis Ship <hl...@gmail.com>.
I suspect your issue is not what you expect. The same Messages
instance is used in all cases, regardless of what method it is invoked
from.

I'm sure it's an issue of what keys you are accessing, and what
.properties file contains each key/value pair.

People often seem to get confused, thinking that the search path for a
component includes the containing page/component's catalog. It does
not.

On Thu, Sep 6, 2012 at 6:34 AM, Yohan Yudanara <yo...@gmail.com> wrote:
> Hi..
>
> I'm using T 5.3.4,
>
> @Inject
> private Messages messages;
>
> messages.get("key") return string from correct local properties file when
> called from "setupRender" and "afterRender".
> But, why messages.get("key") always return string from default local
> properties when called from "onValidate" and "onSuccess" ?
> Am I doing something wrong or is this the expected behavior ?
>
> Thanks in advance...



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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