File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes I18N concept in Struts ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "I18N concept in Struts ??" Watch "I18N concept in Struts ??" New topic

I18N concept in Struts ??

Pawanpreet Singh
Ranch Hand

Joined: Jun 12, 2005
Posts: 264

Could anybody provide me information about I18N concept by Struts.

I have gone through the struts docs and checked that it is not using ResourceBundle but its own technique to accomplish I18N concept.

There is one class org\apache\struts\util\

Please check the documentation of this class.

There is one implementation note

"IMPLEMENTATION NOTE - This class trades memory for speed by caching all messages located via generalizing the Locale under the original locale as well. This results in specific messages being stored in the message cache more than once, but improves response time on subsequent requests for the same locale + key combination. "

What they are trying to make us understand from this note.

Is there anything special in Struts that it is better than simply using ResourceBundles.

Please explain if anybody has idea about this.
Dom Lassy
Ranch Hand

Joined: May 05, 2006
Posts: 181
It is all transparent. All you have to do is create different message bundles for each locale. It will pull the text from the correct bundle based on the client's browser's locale.
Nyanas Kandhan
Ranch Hand

Joined: Jan 27, 2009
Posts: 35
For an example on Struts internationalization you can refer here.

Struts I18N using locale.
Struts Internationalization using browser settings.

Struts Developer

I agree. Here's the link:
subject: I18N concept in Struts ??
It's not a secret anymore!