wood burning stoves*
The moose likes Struts and the fly likes Internationalization:is language selected according to client, or server? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Internationalization:is language selected according to client, or server?" Watch "Internationalization:is language selected according to client, or server?" New topic
Author

Internationalization:is language selected according to client, or server?

Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Hi,
I need to use internationalization (creating various "properties" files in various languages).
Those internationalized essages will be printed out using either :
- struts ( <bean:message > , in the older parts of the system
- JSTL in the new parts of the system.

The question: could anyone tell which language will be used by default: does struts/jstl rely on the *server*'s default language (defined on the operating system), or on the *client*'s language (inferred from the request headers) ?

E.g. suppose I have properties files for both english & french. Also suppose the server is english , and the client is french (indicated by its request headers). Which message will be printed out - english or in french ?

Thanks
Masoud Kalali
Author
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

Hi
Struts I18n use client default language for choosing resource file to use in html message tag.
about jstl , it use fmt message tag which select the resource file by using
client default locale (eg : en_US or it could be two character like hr which indicate just the language.)
in both of this tag you can override the client locale.


hope it helps


Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Thanks very much
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Internationalization:is language selected according to client, or server?