How to change the user optional Language in JSP Struts

Joined
Aug 25, 2006
Messages
1
Reaction score
0
hi all,
i am in a problem. i have a application. i want to provide two language (English and Thai)support in the application. i am using struts. i have already done something but it is not working.. let me tell u what i i have done.
i have 2 property file like
<b>
application_resources_en
application_resource_th
</b>
i have same key in the both property file but the message is different like
<b>
head.detail=Customer Detail
</b>
i made the entry in the struts-config.xml for the message resource property file like
<b>
<message-resources parameter="com.app.resources.application_resources_en" null="false"/>
<message-resources parameter="com.app.resources.application_resources_th" null="false"/>
</b>

i have a action servlet which change the locale as the user option selected like
for English
<b>myLocale = new Locale("en", ""); </b>
for Thai
<b>myLocale = new Locale("th", "");</b>
as the user click the english or Thai language the myLocate instanciated on that

and the locale get seted into te session like
<b>session.setAttribute(org.apache.struts.Globals.LOCALE_KEY, myLocale);</b>

in JSP i have
<bean:message key="head.detail">
But when ever i am changing the locale by user click the same property file gets load. it does not change the key value for different location. i found that the last enty in the struts config for message property file is getting loaded every time. Can any one help me out from this problem? I hope the problem is clear to you all. I hope to receive your quice reply on that.
Thanks in Advance.
Supriyo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,794
Messages
2,569,641
Members
45,355
Latest member
SJLChristi

Latest Threads

Top