portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shins...@apache.org
Subject svn commit: r378005 - in /portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl: DescriptionImpl.java DisplayNameImpl.java
Date Wed, 15 Feb 2006 13:24:52 GMT
Author: shinsuke
Date: Wed Feb 15 05:24:50 2006
New Revision: 378005

URL: http://svn.apache.org/viewcvs?rev=378005&view=rev
Log:
submitted by Cubehead Fang. fixed http://issues.apache.org/jira/browse/JS2-498

Modified:
    portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/DescriptionImpl.java
    portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/DisplayNameImpl.java

Modified: portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/DescriptionImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/DescriptionImpl.java?rev=378005&r1=378004&r2=378005&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/DescriptionImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/DescriptionImpl.java
Wed Feb 15 05:24:50 2006
@@ -103,7 +103,25 @@
 
     public void setLanguage(String lang)
     {
-        this.locale = new Locale(lang);
+        String[] localeArray = lang.split("[-|_]");
+        String country = "";
+        String variant = "";
+        for (int i = 0; i < localeArray.length; i++)
+        {
+            if (i == 0)
+            {
+                lang = localeArray[i];
+            }
+            else if (i == 1)
+            {
+                country = localeArray[i];
+            }
+            else if (i == 2)
+            {
+                variant = localeArray[i];
+            }
+        }
+        this.locale = new Locale(lang, country, variant);
     }
 
 }

Modified: portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/DisplayNameImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/DisplayNameImpl.java?rev=378005&r1=378004&r2=378005&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/DisplayNameImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/DisplayNameImpl.java
Wed Feb 15 05:24:50 2006
@@ -94,7 +94,25 @@
 
     public void setLanguage(String lang)
     {
-        this.locale = new Locale(lang);
+        String[] localeArray = lang.split("[-|_]");
+        String country = "";
+        String variant = "";
+        for (int i = 0; i < localeArray.length; i++)
+        {
+            if (i == 0)
+            {
+                lang = localeArray[i];
+            }
+            else if (i == 1)
+            {
+                country = localeArray[i];
+            }
+            else if (i == 2)
+            {
+                variant = localeArray[i];
+            }
+        }
+        this.locale = new Locale(lang, country, variant);
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message