Balasubramaniam, Sezhiyan wrote:
Thanks a lot Laurie.
I have the ApplicationResources_zh.properties in WEB-INF/classes along
with other locale property files.
The issue is, always I am seeing the default locale, even when I am
explicitly changing the browser locale setting to Chinese.
The things I did are,
I created the ApplicationResources_zh.properties in MS-WORD with UTF-8
encoding (in text editors we could not enter the special language
characters)
That wont work properly; Java requires properties files to be in ASCII
(or maybe Latin-1?). Use the native2ascii utility bundled with the JDK
to convert your UTF-8 encoded file to the correct format.
Coded the jsp with response.setContentType("text/html;charset=UTF-8").
Restarted the server and see the above behaviour.
Is it possible the browser isn't sending the right headers to select
language 'zh'? Try setting the locale explicitly in your JSP and see if
you can get the right messages that way (that'll confirm Struts is
loading the messages correctly). If you can get that working, you can
look into why the locale isn't being auto-detected correctly.
L.
I doubt, my way of creating the property file is wrong.
Please advice.
-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: Tuesday, September 27, 2005 1.54 PM
To: user@struts.apache.org
Subject: Re: i18n and l10n issue - need help
Balasubramaniam, Sezhiyan wrote:
We were giving locale support for English, Spanish, French and German
in
one of our STRUTS 1.0.1 intranet application.
So far, it went smooth as all the resource bundles are ASCII based.
Recently we got some requirements on double byte characters (CHINESE
and
JAPANESE)
Even after we added the ApplicationResources_zh.properties and
ApplicationResources_ja.properties into the classpath, STRUTS is not
picking up the messages.
As we are new to this i18n and l10n, we don't have much clue.
Are we missing some thing? Is there any set-up needed for supporting
the
special languages.
No, it should work the same way as it does for any other language. What
behaviour are you seeing? Do you get missing messages, or messages from
one of the other resource bundles? Is your
ApplicationResources_zh.properties in the same place your other
properties files are? And how are you selecting the locale to use?
On the other side I was reading the STRUTS site and it says,
"Please note that the i18n support in a framework like Struts is
limited
to the presentation of internationalized text and images to the user.
Support for Locale specific input methods (used with languages such as
Japanese, Chinese, and Korean) is left up to the client device, which
is
usually a web browser."
This doesn't effect the rendering of messages, just how the user enters
text into forms and so on. In other words, that's talking about how the
user enters data into your application, not how your application
dispalys data to the user.
L.
---------------------------------------------------------------------
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]