After you set the locale, ensure that cycle.cleanUpRequest (I dont quite remember the method name), is called and then re-activate the page you want to get the locale refreshed.
On 2/12/06, Sebastiaan van Erk <[EMAIL PROTECTED]> wrote: > > Hi, > > After some more reading I found out that Tapestry already saves the user > locale in a cookie, so that's good and it only comes down to setting the > default locale. In the Wiki I found the following page: > > http://wiki.apache.org/jakarta-tapestry/DefaultLocale > > which says to override the base engine to do: > > public final void setLocale(Locale locale) > { > if (getLocale() == null) > super.setLocale(new Locale(defaultLanguage, defaultCountry)); > else > super.setLocale(locale); > } > > First of all this doesn't seem like "the Tapestry 4" way of doing > things, but secondly, I tried this and it did not work. I display the > engine locale on my pages and it clearly shows that it *is* the default > locale, but the pages are still displayed in the request's locale (which > in this case happened to be a different but accepted locale). > > What is the correct way to set the default locale? Should I register my > own RequestLocaleManager on the RequestLocaleManager service point? > > Thanks in advance, > Sebastiaan > > Sebastiaan van Erk wrote: > > Hi, > > > > How can you set the locale of a page on the *first* page load of the > > entire application. I store the locale in a cookie, and when the user > > comes to the login page I want it to display in their favorite locale. > > > > I searched the list and learned that you can change the locale in a > > listener by: > > > > cycle.cleanup(); > > throw new PageRedirectException(this); > > > > However, this does NOT work in the pageBeginRender method... Maybe it's > > already too late to try to change the locale there, but I don't know > > where to change it otherwise. Does anybody know how to do it before the > > first page of the application is displayed? > > > > Thanks in advance! > > > > Greetings, > > Sebastiaan > > > > --------------------------------------------------------------------- > > 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] > >
