You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "F. Da Costa" <da...@xs4all.nl> on 2004/02/05 18:55:43 UTC
Timing of locale setting for the engine
Hi,
I was wondering *when* the default locale gets set for the engine?
In the following snip _locale gets set to en_US (as per the machine its
running on). At this point (initialize()) I cannot use getLocale() not via
the getEngine()... Which is ok by me.
public class Home1 extends org.apache.tapestry.html.BasePage {
private Locale _locale;
protected void initialize() {
super.initialize();
if (_locale==null) _locale = Locale.getDefault();
}
public boolean isDef() {
return (_locale==getEngine().getLocale());
}
However, going into isDef() the engine suddenly carries nl_NL (indeed,
that's where I live). Now, where did the engine get that from (could not be
my machine).
This is probably one of those 'you just have to know' things which I don't
yet because this is my first dabble in locale stuff.
TIA
Fermin DCG
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Timing of locale setting for the engine (DONE)
Posted by "F. Da Costa" <da...@xs4all.nl>.
F. Da Costa wrote:
> Hi,
>
> I was wondering *when* the default locale gets set for the engine?
>
Figured it out it had something to do with cookies and the ApplicationServlet.
> In the following snip _locale gets set to en_US (as per the machine its
> running on). At this point (initialize()) I cannot use getLocale() not
> via the getEngine()... Which is ok by me.
>
> public class Home1 extends org.apache.tapestry.html.BasePage {
> private Locale _locale;
>
> protected void initialize() {
> super.initialize();
> if (_locale==null) _locale = Locale.getDefault();
> }
>
> public boolean isDef() {
> return (_locale==getEngine().getLocale());
> }
>
> However, going into isDef() the engine suddenly carries nl_NL (indeed,
> that's where I live). Now, where did the engine get that from (could not
> be my machine).
>
Thx to cookie still set on client. Remove cookie and things fall into place.
Quite nicely as well.
> This is probably one of those 'you just have to know' things which I
> don't yet because this is my first dabble in locale stuff.
>
> TIA
> Fermin DCG
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org