You might look at the tag I posted to bugzilla as an example. Feel free to hack it to suit your needs.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12648

David






From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Eric Tse <[EMAIL PROTECTED]>
CC: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: i18n implementation
Date: Fri, 6 Dec 2002 18:34:03 -0800 (PST)



On Fri, 6 Dec 2002, Eric Tse wrote:

> Date: Fri, 6 Dec 2002 12:07:59 +0800
> From: Eric Tse <[EMAIL PROTECTED]>
> Reply-To: Eric Tse <[EMAIL PROTECTED]>
> To: Craig R. McClanahan <[EMAIL PROTECTED]>
> Cc: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: i18n implementation
>
> Hi Craig,
>
> Thanks for your email! I have just tried your latest nighty build and it is
> what I want to have!! Thanks a lot!!
>
> I have one more question. Where or which setting do <bean:message
> key="index.logon"/> in index.jsp detects it is in Japanese locale? I
> observed that the Locale is set to ja when I access index.jsp and
> corresponding ApplicationResources_ja.properties is loaded. Since I need to
> make a language selection screen at index.jsp, does it mean i need to
> hardcode the English message instead of specifiying any <bean:message ..../>
> ?
>

Struts stores the user's selected Locale as a session attribute under the
key Action.LOCALE_KEY. If there's no such attribute already, it chooses
based on the user's preferred language (which is sent in the
"Accept-Languages" HTTP header).

To create your own language chooser, simply set up a simple form with just
a select box listing the languages you support, and submit to an Action
that reads the specified selection, creates a corresponding Locale, and
stores it in the session attribute under the specified key. This
selection will hold until the user changes it, or until the session
expires or is timed out.

> Thanks a lot.
>
> Regards,
> Eric

Craig



--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to