• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I18N concept in Struts ??

 
Pawanpreet Singh
Ranch Hand
Posts: 264
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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\PropertyMessageResources.java.

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
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For an example on Struts internationalization you can refer here.

Struts I18N using locale.
Struts Internationalization using browser settings.

regards
Struts Developer

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic