struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Franz Wong <franzw...@gmail.com>
Subject Strange behaviour on i18n
Date Sun, 11 Jul 2010 05:23:32 GMT
Hi,

I have an i18n web site with struts 2. I don't know why the i18n text is not
loaded properly. I expect "檢索詞不能空白" (Chinese characters), but it turns out
"檢索詞不不能空白". But if I make any change on the html (e.g. the order of
attributes or remove some elements), the text is loaded without any problem.

Thanks.
Franz

Problem html code :

<input type="button" value="<s:text name="search"/>"
onClick="searchButtonClick('<s:text name="search.searchTermCannotBeEmpty"
/>');"/>

(HTML : <input
type="button" value="檢索" onClick="searchButtonClick('檢索詞不不能空白');"/>)

However, the following html code works fine.

<input type="button" onClick="searchButtonClick('<s:text
name="search.searchTermCannotBeEmpty" />');" value="<s:text
name="search"/>"/>

(HTML : <input type="button" onClick="searchButtonClick('檢索詞不能空白');"
value="檢索"/>)

Properties file :

search.searchMethod=檢索方法
search.searchMethod.Title=書名
search.searchMethod.Author=著者
search.searchMethod.Subject=主題
search.searchMethod.Series=叢書
search.searchMethod.TitleKeyword=書名關鍵詞
search.searchMethod.AuthorKeyword=著者關鍵詞
search.searchMethod.SubjectKeyword=主題關鍵詞
search.searchTerm=檢索詞
search.searchTermCannotBeEmpty=檢索詞不能空白
search=檢索

Here is the whole jsp file.

<%@taglib prefix="s" uri="/struts-tags" %>
<select id="searchMethod">
<option value="Title"><s:text name="search.searchMethod.Title"/></option>
<option value="Author"><s:text name="search.searchMethod.Author"/></option>
<option value="Subject"><s:text
name="search.searchMethod.Subject"/></option>
<option value="Series"><s:text name="search.searchMethod.Series"/></option>
<option value="TitleKeyword"><s:text
name="search.searchMethod.TitleKeyword"/></option>
<option value="AuthorKeyword"><s:text
name="search.searchMethod.AuthorKeyword"/></option>
<option value="SubjectKeyword"><s:text
name="search.searchMethod.SubjectKeyword"/></option>
</select>
<input type="text" id="searchTerm" size="30" class="searchTermEmpty"
value="<s:text name="search.searchTerm" />" onFocus="searchTermOnFocus(this,
'<s:text name="search.searchTerm" />');" onBlur="searchTermOnBlur(this,
'<s:text name="search.searchTerm" />');"/>
<input type="button" value="<s:text name="search"/>"
onClick="searchButtonClick('<s:text name="search.searchTermCannotBeEmpty"
/>');"/>
<span id="searchResult"></span>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message