You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Hardi Rokk <me...@mail.ee> on 2006/10/03 09:15:24 UTC
Setting locale in stateless app
Hi everyone,
I am trying to make stateless tapestry application where i give user
preferred language as GET parameter (like: language=en). But i can't
find the right place to set the tapestry locale - on the pages java file
it is already too late since the page is loaded from pool in some
specific (default?) locale. So setting locale should be done somewhere
before getting page from the pool. Any ideas where and how should
stateless applications locale be set?
P.S. language as GET parameter is in requirements, so there's no
changing that.
Best Regards,
hardi
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Setting locale in stateless app
Posted by Malin Ljungh <ma...@kvadrat.se>.
I'm intressted in doing about the same.
Can you explain in more detail how you solved it?
Malin
On 10/3/06, Hardi Rokk <me...@mail.ee> wrote:
>
> Answering my own question:
>
> I resolved this problem by overriding
> tapestry.request.RequestLocaleManager service point in my hivemind conf
> and just added into extractLocaleForCurrentRequest() code to read
> language parameter from request and using this as user locale. Not sure
> if it is the best way, but it seems to work...
>
> hardi
>
>
> Hardi Rokk wrote:
> > Hi everyone,
> >
> > I am trying to make stateless tapestry application where i give user
> > preferred language as GET parameter (like: language=en). But i can't
> > find the right place to set the tapestry locale - on the pages java file
> > it is already too late since the page is loaded from pool in some
> > specific (default?) locale. So setting locale should be done somewhere
> > before getting page from the pool. Any ideas where and how should
> > stateless applications locale be set?
> >
> > P.S. language as GET parameter is in requirements, so there's no
> > changing that.
> >
> > Best Regards,
> > hardi
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Setting locale in stateless app
Posted by Hardi Rokk <me...@mail.ee>.
Answering my own question:
I resolved this problem by overriding
tapestry.request.RequestLocaleManager service point in my hivemind conf
and just added into extractLocaleForCurrentRequest() code to read
language parameter from request and using this as user locale. Not sure
if it is the best way, but it seems to work...
hardi
Hardi Rokk wrote:
> Hi everyone,
>
> I am trying to make stateless tapestry application where i give user
> preferred language as GET parameter (like: language=en). But i can't
> find the right place to set the tapestry locale - on the pages java file
> it is already too late since the page is loaded from pool in some
> specific (default?) locale. So setting locale should be done somewhere
> before getting page from the pool. Any ideas where and how should
> stateless applications locale be set?
>
> P.S. language as GET parameter is in requirements, so there's no
> changing that.
>
> Best Regards,
> hardi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org