Vincent, I found out what's going on. I have set up the Chinese(Taiwan) (zh_TW) for my input method in Windows. The Java was too smart to pick it up as my default locale.
Billy Ng ---------------------------------------------------- This mailbox protected from junk email by Matador from MailFrontier, Inc. http://info.mailfrontier.com ----- Original Message ----- From: "Vincent Lin" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; "Billy Ng" <[EMAIL PROTECTED]> Sent: Thursday, March 04, 2004 10:06 PM Subject: Re: Using ApplicationResources.properties problem > Try this in your action class: > > HttpSession session = request.getSession(); > session.setAttribute(org.apache.struts.Globals.LOCALE_KEY, > java.util.Locale.ENGLISH); > > It will set the default locale of struts to ENGLISH. > But I am not sure if struts will take the missing > message from ApplicationResources.properties or > ApplicationResources_en_US.properties. > > I am a little confused too. Please let me know if it > works. > > Regards, > Vincent > > --- Billy Ng <[EMAIL PROTECTED]> :> Sorry, I > misunderstood your email. Let me try to > > set the default locale > > with LOCALE_KEY in the session. It will be great if > > you have any example > > that oyu can show me, thanks! > > > > Billy Ng > > ---------------------------------------------------- > > This mailbox protected from junk email by Matador > > from MailFrontier, Inc. http://info.mailfrontier.com > > > > ----- Original Message ----- > > From: "Vincent Lin" <[EMAIL PROTECTED]> > > To: "Struts Users Mailing List" > > <[EMAIL PROTECTED]>; "Billy Ng" > > <[EMAIL PROTECTED]> > > Sent: Thursday, March 04, 2004 7:34 PM > > Subject: Re: Using ApplicationResources.properties > > problem > > > > > > > I think the default locale is set in session scope > > > with the key org.apache.struts.Globals.LOCALE_KEY. > > > In my experience, if you don't set default locale, > > > struts will take the locale setting of the client > > > browser. Are you using zh_TW as the default locale > > in > > > your browser? > > > > > > Regards, > > > Vincent > > > > > > --- Billy Ng <[EMAIL PROTECTED]> > I am going > > to > > > localize the product. The > > > > getResources().getMessage() method just works > > fine > > > > with the following properties files. > > > > > > > > ApplicationResources.properties > > > > ApplicationResources_en_US.properties > > > > ApplicationResources_fr_FR.properties > > > > > > > > However, if I add the > > > > ApplicationResources_zh_TW.properties, the > > > > getResources().getMessage() will pick up the > > missing > > > > key-value pairs from > > > > ApplicationResources_zh_TW.properties instead of > > > > ApplicationResources.properties. Why? I thought > > > > ApplicationResources.properties was the defualt. > > > > > > > > ApplicationResources.properties > > > > ApplicationResources_en_US.properties > > > > ApplicationResources_fr_FR.properties > > > > ApplicationResources_zh_TW.properties > > > > > > > > > > > > > > ---------------------------------------------------- > > > > This mailbox protected from junk email by > > Matador > > > > from MailFrontier, Inc. > > http://info.mailfrontier.com > > > > > > > > > > > > > > > > > > > ----------------------------------------------------------------- > > > 每天都 Yahoo!奇摩 > > > 海的顏色、風的氣息、愛你的溫度,盡在信紙底圖 > > > > > > http://tw.promo.yahoo.com/mail_premium/stationery.html > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > ----------------------------------------------------------------- > 每天都 Yahoo!奇摩 > 海的顏色、風的氣息、愛你的溫度,盡在信紙底圖 > http://tw.promo.yahoo.com/mail_premium/stationery.html > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

