I observed a similar behavior, which I traced back to the
RequestLocaleManagerImpl (see my post on the subject: <http://www.nabble.com/Bug-in-RequestLocaleManagerImpl--td16688991.html#a16688991
>).
As I have not received a response (and my implementation, which is
attached, seems to have solved the problem), I believe this is the
proper solution.
You can override using the default implementation by configuring it in
your WEB-INF/hivemodule.xml:
<implementation service-id="tapestry.request.RequestLocaleManager">
<invoke-factory model="pooled">
<construct
class="com.emtrack.web.service.RequestLocaleManagerImpl">
<set-service property="request" service-
id="tapestry.globals.WebRequest" />
<set-object property="cookieSource"
value="infrastructure:cookieSource" />
<set-service property="threadLocale" service-
id="hivemind.ThreadLocale" />
<set-object property="acceptedLocales" value="app-
property:org.apache.tapestry.accepted-locales" />
</construct>
</invoke-factory>
</implementation>
On May 7, 2008, at 9:28 AM, dpark wrote:
Thanks for the help but unfortunately that doesn't seem to work.
Here's what
I do:
public void setLanguage( String language )
{
getEngine().setLocale( new Locale( language ) );
getRequestCycle().cleanup();
throw new PageRedirectException( "Login" );
}
Are you telling me that for your application, every subsequent page
(not
just the one immediately after), after setting the locale, renders
in the
appropriate Locale?
Must be something with my pool....(i haven't done any customizations
around
that...)
I'll keep poking around
DP
Jonathan Barker wrote:
Try executing cycle.cleanup() after you set the Locale.
-----Original Message-----
From: dpark [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 07, 2008 10:14 AM
To: users@tapestry.apache.org
Subject: Localization
I understand the following:
* in order to set the locale programmatically, you call the
following:
getEngine().setLocale( new Locale( language ) );
* then I call getRequestCycle().activate( "SOME_PAGE" );
* Voila, I see the SOME_PAGE loaded with the locale specific
properties
and
assets.
HOWEVER, when I then navigate to another page, I suddenly lose the
locale
i
just set.
Upon further investigation I see that the RequestLocaleManagerImpl
is
working correctly by reading the cookie and setting the ThreadLocale
appropriately.
I'm guessing there's something about the pool of pages that need
to be
reset
to the appropriate locale.
Can anyone shed some light on how (if at all) there's a way to do
this?
Thanks!
DP
--
View this message in context: http://www.nabble.com/Localization-
tp17106010p17106010.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
View this message in context:
http://www.nabble.com/Localization-tp17106010p17106173.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]