You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Rajan Gupta <rg...@yahoo.com> on 2001/08/09 22:38:59 UTC

Struts & Internationalization

I believe that Application Resource file is used for getting internalized
messages for text to be displayed on the screen. How do we specify
different application resources depending upon locale to be picked up. Can
we specify multiple application resources for ActionServlet init. 
I believe the answer is in MessageTag but do not know how to use the
international feature the way it is intended to be used.

Can somebody throw in some pointers to any documents?

Thanks
Rajan



__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Re: Struts & Internationalization

Posted by Ted Husted <hu...@apache.org>.
The best place to ask a questoin like this is Struts-USER where there
are more people to help you, so i'll copy them in on a brief reply ;-)

The Application Resources files can be named after the locales in the
usual way, and then the appropriate locale is automatically selected for
each user, based on a locale attribute in their session.

Rajan Gupta wrote:
> 
> I believe that Application Resource file is used for getting internalized
> messages for text to be displayed on the screen. How do we specify
> different application resources depending upon locale to be picked up. Can
> we specify multiple application resources for ActionServlet init.
> I believe the answer is in MessageTag but do not know how to use the
> international feature the way it is intended to be used.
> 
> Can somebody throw in some pointers to any documents?
> 
> Thanks
> Rajan
> 
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/

Re: Struts & Internationalization

Posted by Ted Husted <hu...@apache.org>.
The best place to ask a questoin like this is Struts-USER where there
are more people to help you, so i'll copy them in on a brief reply ;-)

The Application Resources files can be named after the locales in the
usual way, and then the appropriate locale is automatically selected for
each user, based on a locale attribute in their session.

Rajan Gupta wrote:
> 
> I believe that Application Resource file is used for getting internalized
> messages for text to be displayed on the screen. How do we specify
> different application resources depending upon locale to be picked up. Can
> we specify multiple application resources for ActionServlet init.
> I believe the answer is in MessageTag but do not know how to use the
> international feature the way it is intended to be used.
> 
> Can somebody throw in some pointers to any documents?
> 
> Thanks
> Rajan
> 
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/

Re: Struts & Internationalization

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 9 Aug 2001, Rajan Gupta wrote:

> I believe that Application Resource file is used for getting internalized
> messages for text to be displayed on the screen. How do we specify
> different application resources depending upon locale to be picked up. Can
> we specify multiple application resources for ActionServlet init. 
> I believe the answer is in MessageTag but do not know how to use the
> international feature the way it is intended to be used.
> 

You only need to specify one base name, but provide multiple files with
the various translations for each Locale:

  ApplicationResources.properties           Default locale
  ApplicationResources_es.properties        Spanish
  ApplicationResources_fr.properties        French
  ApplicationResources_en_GB.properties     British English
                                            (who don't always know
                                            how to spell :-)

and so on.

> Can somebody throw in some pointers to any documents?
> 

Check out the JavaDocs for java.util.ResourceBundle, and the section on
Internationalization in the JDK Documentation Set.  Even though Struts
doesn't use ResourceBundles internally, the resource files are handled the
same way.

> Thanks
> Rajan
> 

Craig McClanahan