Sorry for the multiple posts, but maybe I should explain our localization
more. We don't use different templates. According to the docs, the IEngine's
locale "is used when selecting templates and assets." We do have multiple
.properties files, however. These don't seem to rely on the Engine like the
templates do.

The localization page says this about the setting the locale in the engine:
you must obtain the IEngine and invoke setLocale() on it. This will change
the value stored in the engine (which is used when loading new pages), and:
*Update the hivemind.ThreadLocale service, allowing localized messages from
services to be generated in the correct locale
*Cause an HTTP Cookie to be added to the request so that future requests
from the same client will be in the same locale

I don't see how changing the locale in the engine will ever write this
cookie. Updating the ThreadLocale service will only happen if the
infrastructure exists. In our case, we are setting this when the home page
begins rendering, and the infrastructure doesn't exist yet.



On 11/16/05, Chris Norris <[EMAIL PROTECTED]> wrote:
> Been doing more research. The RequestLocaleManagerImpl class seems to
manage the Locale that pages are instantiated with. It first checks for a
cookie that has the locale cookie with the name
TapestryConstants.LOCALE_COOKIE_NAME. If that doesn't work, it uses the
request's default locale setting, which must come from the browser.
>
> From what I can tell, the engine's locale is just used for page pool stuff
and as a key for storing engine instances. But I'm not sure.
>
> So my questions are these:
> *Will setting the locale cookie be enough to take care of everything? Are
there any hidden gotchas?
> *What's the best place to plug in to manage the locale stuff myself?
>
>
>
> On 11/16/05, Chris Norris < [EMAIL PROTECTED] > wrote:
> > How do I manually set the locale for tapestry? We want language to be a
user definable thing, rather than relying on the browser. We used to do this
in T3 with a getEngine().setLocale(). This method is still being called and
the Engine keeps the right locale, but localization is still done in some
places based on the browser setting. It seems to ignore the Engine property.
> >
> > I see that the Infrastructure has a locale, but I haven't found any good
documentation, although that may be a problem on my part, about the
Infrastructure.
> >
> > -Chris
> >
>
>

Reply via email to