On Sat, 26 Oct 2002, Gemes Tibor wrote:
> Date: Sat, 26 Oct 2002 10:56:54 +0200
> From: Gemes Tibor <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: change locale on form-login-page
>
> Is this possible?
>
> I added a few links to the login page, which changes the Locale. The user sets
> its locale in the session at the org.apache.struts.action.LOCALE_KEY, but
> this takes effect after the successful login. How could I use the selected
> Locale for the login-page itself?
>
How are you planning on letting the user choose the locale before they've
logged in? That sounds like a catch-22.
When Struts sees a request that does not have a Locale in the session
already, it looks at the Accept-Language header included in the request.
In turn, this is set by the language preferences you've selected in your
browser -- the first one you list will be the one that Struts picks, and
will stay there until you change it (by replacing the seesion attribute).
Therefore, if the login page is the very first page that the user sees,
tell them to change their browser settings. And don't forget to include:
<html:html locale="true">
... contents of the login page ...
</html:html>
if the user is linking directly to the login page rather than going
through the controller servlet.
> The problem is that the Locale change was successful, thou it is not
> recognisable to the user untill the login. I want to display the form-login
> page i18n'ed as well as all other pages are.
>
> Tia,
>
> Tib
Craig
--
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>