aspose file tools*
The moose likes Struts and the fly likes How to :  Internationalization in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to :  Internationalization in Struts" Watch "How to :  Internationalization in Struts" New topic
Author

How to : Internationalization in Struts

somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
How to use/config Internationalization in Struts (I18N) ???


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
prabhat kumar
Ranch Hand

Joined: Apr 11, 2001
Posts: 114
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

Joined: Jul 04, 2003
Posts: 1312
It's work...

I'm use with thai and english language.


Thank you very much.
prabhat kumar
Ranch Hand

Joined: Apr 11, 2001
Posts: 114
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to : Internationalization in Struts