[ 
https://issues.apache.org/struts/browse/WW-2345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45545#action_45545
 ] 

Qunhuan Mei commented on WW-2345:
---------------------------------

The Struts2's I18n handler may have a problem handling Chinese.

I have been following the Struts2's blank HellowWorld example (from 
struts2-blank-2.0.14.war). It shows a good example of dynamically switching 
locale between English and Spanish. They worked fine under my eclipse (V3.4) 
Tomcat (6.0) setting. During the exercise, I decided to try on Chinese. So I 
created a package_zh.properties file (by simply copying package.properties file 
and renamed it and replaced the value part with Chinese characters and saved it 
in utf-8. I also added following lines to HelloWorld.jsp 
<li>
        <s:url id="url" action="HelloWorld">
            <s:param name="request_locale">zh</s:param>
        </s:url>
        <s:a href="%{url}">Chinese</s:a>
</li> 
However, when I run the project and click on Chinese, the displayed characters 
are not recognisable (kind of utf-8 Chinese rendered in non utf-8 encoding). I 
also tried adding 
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> to the 
header part, but the result is the same. 

(If you don't know Chinse, you can simply use a translator such as Google to 
produce Chinese Characters and copy them in the package_zh.properties file and 
see if their appearance changes when "Chinese" is clicked)

Is it a bug?

Many thanks,

Qunhuan Mei


> Default locale is not evaluated always using client default locale
> ------------------------------------------------------------------
>
>                 Key: WW-2345
>                 URL: https://issues.apache.org/struts/browse/WW-2345
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.0.9, 2.0.11, 2.1.0
>         Environment: Italian Server / Spanish browser
>            Reporter: Andrea Gigliotti
>             Fix For: Future
>
>         Attachments: blank.tar.gz
>
>
> Using the blank webapp, adding the "package_it.properties" file, there is a 
> strange behaviour if you have the default locale of the server different from 
> "en" (in this case "it_IT") and the client different from "en" (in this case 
> "es_ES").
> Calling the homepage of the blank webapp, the default locale is evaluated 
> using the client default locale ("es_ES"), but clicking on "English" (thus 
> selecting the "en" locale, that is not defined), it should use the default 
> "client" locale, while it uses the "server" default locale.
> Notice that clearing the cookies and then calling the homepage again, it 
> works correctly.
> -----------------
> The original description of the issue was:
> I tried using the example application (struts2-blank-2.0.11.war) and it 
> working fine using package_es.properties and package.properties, that is I 
> getting the messages in the right language. 
> I got the same result using package_fr.properties rather than 
> package_es.properties, they working fine!
> But if I rename the package_es.properties in package_it.properties, it did't 
> work, that is the messages are always displayed in the O.S. language. 
> Anyone can help me?
> It seems to be a bug related with the "it" extension !!! 
> Thank's for your time! 
> Andrea

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to