[pal-cvs 3626] [1361] i18ned display name.

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 11月 18日 (火) 10:04:14 JST


Revision: 1361
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=1361
Author:   shinsuke
Date:     2008-11-18 10:04:14 +0900 (Tue, 18 Nov 2008)

Log Message:
-----------
i18ned display name.

Modified Paths:
--------------
    userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exentity/UserInfo.java
    userinfo/trunk/src/main/resources/application.properties
    userinfo/trunk/src/main/resources/application_ja.properties
    userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/index.jsp


-------------- next part --------------
Modified: userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exentity/UserInfo.java
===================================================================
--- userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exentity/UserInfo.java	2008-11-18 00:49:30 UTC (rev 1360)
+++ userinfo/trunk/src/main/java/jp/sf/pal/userinfo/db/exentity/UserInfo.java	2008-11-18 01:04:14 UTC (rev 1361)
@@ -1,5 +1,7 @@
 package jp.sf.pal.userinfo.db.exentity;
 
+import org.apache.commons.lang.StringUtils;
+
 /**
  * The entity of USER_INFO.
  * <p>
@@ -14,4 +16,32 @@
 
     /** Serial version UID. (Default) */
     private static final long serialVersionUID = 1L;
+
+    public String getNameArg0() {
+        if (StringUtils.isEmpty(getGivenName())
+                && StringUtils.isEmpty(getFamilyName())) {
+            return getUserId();
+        }
+        return getGivenName() != null ? getGivenName() : "";
+    }
+
+    public String getNameArg1() {
+        return getFamilyName() != null ? getFamilyName() : "";
+    }
+
+    public String getNameArg2() {
+        if (StringUtils.isEmpty(getGivenName())
+                && StringUtils.isEmpty(getFamilyName())) {
+            return "";
+        }
+        return getMiddleName() != null ? getMiddleName() : "";
+    }
+
+    public String getNameArg3() {
+        return getGivenNameDesc() != null ? getGivenNameDesc() : "";
+    }
+
+    public String getNameArg4() {
+        return getFamilyNameDesc() != null ? getFamilyNameDesc() : "";
+    }
 }

Modified: userinfo/trunk/src/main/resources/application.properties
===================================================================
--- userinfo/trunk/src/main/resources/application.properties	2008-11-18 00:49:30 UTC (rev 1360)
+++ userinfo/trunk/src/main/resources/application.properties	2008-11-18 01:04:14 UTC (rev 1361)
@@ -5,6 +5,11 @@
 msg.header=<ul>
 msg.footer=</ul>
 
+# 0: Given name, 1: Family name, 2: Middle Name
+display.name={0} {2} {1}
+# 0: Given name, 1: Family name, 2: Middle Name, 3: Given name(Reading), 4: Family name(Reading)
+long.display.name={0} {2} {1}
+
 errors.invalid={0} is invalid.
 errors.maxlength={0} can not be greater than {1} characters.
 errors.minlength={0} can not be less than {1} characters.
@@ -88,6 +93,7 @@
 
 labels.confirmation_of_user_info=Confirmation of User Info
 labels.user_id=User ID
+labels.name=Name
 labels.given_name=Given Name
 labels.given_name_desc=Given Name (Reading)
 labels.family_name=Family Name

Modified: userinfo/trunk/src/main/resources/application_ja.properties
===================================================================
--- userinfo/trunk/src/main/resources/application_ja.properties	2008-11-18 00:49:30 UTC (rev 1360)
+++ userinfo/trunk/src/main/resources/application_ja.properties	2008-11-18 01:04:14 UTC (rev 1361)
@@ -1,3 +1,8 @@
+# 0: Given name, 1: Family name, 2: Middle Name
+display.name={1} {0}
+# 0: Given name, 1: Family name, 2: Middle Name, 3: Given name(Reading), 4: Family name(Reading)
+long.display.name={1} {0} ({4} {3})
+
 errors.invalid={0} \u306b\u306f\u6b63\u3057\u3044\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002
 errors.maxlength={0} \u306f {1} \u6587\u5b57\u4ee5\u4e0b\u3067\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002
 errors.minlength={0} \u306f {1} \u6587\u5b57\u4ee5\u4e0a\u5165\u529b\u3057\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002
@@ -81,6 +86,7 @@
 
 labels.confirmation_of_user_info=\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u306e\u767b\u9332
 labels.user_id=\u30e6\u30fc\u30b6\u30fc ID
+labels.name=\u540d\u524d
 labels.given_name=\u540d
 labels.given_name_desc=\u540d(\u3088\u307f)
 labels.family_name=\u59d3

Modified: userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/index.jsp
===================================================================
--- userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/index.jsp	2008-11-18 00:49:30 UTC (rev 1360)
+++ userinfo/trunk/src/main/webapp/WEB-INF/view/userInfo/index.jsp	2008-11-18 01:04:14 UTC (rev 1361)
@@ -34,8 +34,7 @@
 	<thead>
 		<tr>
 			<th style="width:100px;text-align: center;"><bean:message key="labels.user_id"/></th>
-			<th style="width:100px;text-align: center;"><bean:message key="labels.family_name"/></th>
-			<th style="width:100px;text-align: center;"><bean:message key="labels.given_name"/></th>
+			<th style="width:250px;text-align: center;"><bean:message key="labels.name"/></th>
 			<th style="width:200px;text-align: center;"><bean:message key="labels.email"/></th>
 			<th style="width:100px;text-align: center;">&nbsp;</th>
 		</tr>
@@ -44,8 +43,7 @@
 		<c:forEach var="u" varStatus="s" items="${userInfoItems}">
 		<tr class="${s.index %2 == 0 ? 'row1' : 'row2'}">
 			<td><s:link href="confirmpage/4/${f:u(u.userId)}">${f:h(u.userId)}</s:link></td>
-			<td>${f:h(u.familyName)}</td>
-			<td>${f:h(u.givenName)}</td>
+			<td><bean:message key="long.display.name" arg0="${f:h(u.nameArg0)}" arg1="${f:h(u.nameArg1)}" arg2="${f:h(u.nameArg2)}" arg3="${f:h(u.nameArg3)}" arg4="${f:h(u.nameArg4)}"/></td>
 			<td>${f:h(u.email)}</td>
 			<td align="center">
 				<s:link href="editpage/2/${f:u(u.userId)}"><bean:message key="labels.edit"/></s:link>


pal-cvs メーリングリストの案内
Back to archive index