Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to : Internationalization in Struts

 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to use/config Internationalization in Struts (I18N) ???
 
prabhat kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one possibility is to use applicationresources. like this:
struts finds the client language from the request and calls the specific applicationresource file automatically.
suppose the name of your application resource file is
ApplicationResources.properties => this file is used for default language/English
now if oyu want to add support German language the create a new resource file with same name .. but add _de at the end like this:
ApplicationResources_de.properties => now when struts finds an german request then it will load the resources from ApplicationResources_de.properties file.

===========
using resources:
resources can be used by bean:message tag like :
<bean:message key="title.login"/>
entries in respectives files looks like =>
default:
title.login=New Admin console
_de:
title.login=Admin Konsole
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's work...

I'm use with thai and english language.


Thank you very much.
 
prabhat kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one possibility is to use applicationresources. like this:
struts finds the client language from the request and calls the specific applicationresource file automatically.
suppose the name of your application resource file is
ApplicationResources.properties => this file is used for default language/English
now if oyu want to add support German language the create a new resource file with same name .. but add _de at the end like this:
ApplicationResources_de.properties => now when struts finds an german request then it will load the resources from ApplicationResources_de.properties file.

===========
using resources:
resources can be used by bean:message tag like :
<bean:message key="title.login"/>
entries in respectives files looks like =>
default:
title.login=New Admin console
_de:
title.login=Admin Konsole
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic