cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r349891 - in /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon: i18n/I18nUtils.java transformation/I18nTransformer.java
Date Wed, 30 Nov 2005 06:24:03 GMT
Author: joerg
Date: Tue Nov 29 22:23:57 2005
New Revision: 349891

URL: http://svn.apache.org/viewcvs?rev=349891&view=rev
Log:
moved back the i18n namespace constants to I18nTransformer

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/i18n/I18nUtils.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/I18nTransformer.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/i18n/I18nUtils.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/i18n/I18nUtils.java?rev=349891&r1=349890&r2=349891&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/i18n/I18nUtils.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/i18n/I18nUtils.java Tue Nov 29
22:23:57 2005
@@ -22,6 +22,7 @@
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.Session;
 import org.apache.cocoon.environment.Response;
+import org.apache.cocoon.transformation.I18nTransformer;
 import org.apache.cocoon.util.Deprecation;
 
 import java.util.Enumeration;
@@ -42,18 +43,6 @@
     private static final String LOCALE_DELIMITER = "_-@.";
 
     /**
-     * The namespace for i18n is "http://apache.org/cocoon/i18n/2.1".
-     */
-    public static final String I18N_NAMESPACE_URI =
-            "http://apache.org/cocoon/i18n/2.1";
-
-    /**
-     * The old namespace for i18n is "http://apache.org/cocoon/i18n/2.0".
-     */
-    public static final String I18N_OLD_NAMESPACE_URI =
-            "http://apache.org/cocoon/i18n/2.0";
-
-    /**
      * Did we already encountered an old namespace? This is static to ensure
      * that the associated message will be logged only once.
      */
@@ -263,13 +252,13 @@
     }
 
     public static boolean matchesI18nNamespace(String uri) {
-        if (I18N_NAMESPACE_URI.equals(uri)) {
+        if (I18nTransformer.I18N_NAMESPACE_URI.equals(uri)) {
             return true;
-        } else if (I18N_OLD_NAMESPACE_URI.equals(uri)) {
+        } else if (I18nTransformer.I18N_OLD_NAMESPACE_URI.equals(uri)) {
             if (!deprecationFound) {
                 deprecationFound = true;
-                Deprecation.logger.warn("The namespace <" + I18N_OLD_NAMESPACE_URI +
-                                        "> is deprecated, use: <" + I18N_NAMESPACE_URI
+ ">");
+                Deprecation.logger.warn("The namespace <" + I18nTransformer.I18N_OLD_NAMESPACE_URI
+
+                                        "> is deprecated, use: <" + I18nTransformer.I18N_NAMESPACE_URI
+ ">");
             }
             return true;
         }

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/I18nTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/I18nTransformer.java?rev=349891&r1=349890&r2=349891&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/I18nTransformer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/I18nTransformer.java
Tue Nov 29 22:23:57 2005
@@ -892,6 +892,18 @@
     // Date and number elements and params formatting attributes with values.
     private HashMap formattingParams;
 
+    /**
+     * The namespace for i18n is "http://apache.org/cocoon/i18n/2.1".
+     */
+    public static final String I18N_NAMESPACE_URI =
+            "http://apache.org/cocoon/i18n/2.1";
+
+    /**
+     * The old namespace for i18n is "http://apache.org/cocoon/i18n/2.0".
+     */
+    public static final String I18N_OLD_NAMESPACE_URI =
+            "http://apache.org/cocoon/i18n/2.0";
+
 
     /**
      * Returns the current locale setting of this transformer instance.
@@ -1195,17 +1207,17 @@
             currentKey = attr.getValue("", I18N_KEY_ATTRIBUTE);
             if (currentKey == null) {
                 // Try the namespaced attribute
-                currentKey = attr.getValue(I18nUtils.I18N_NAMESPACE_URI, I18N_KEY_ATTRIBUTE);
+                currentKey = attr.getValue(I18nTransformer.I18N_NAMESPACE_URI, I18N_KEY_ATTRIBUTE);
                 if (currentKey == null) {
                     // Try the old namespace
-                    currentKey = attr.getValue(I18nUtils.I18N_OLD_NAMESPACE_URI, I18N_KEY_ATTRIBUTE);
+                    currentKey = attr.getValue(I18nTransformer.I18N_OLD_NAMESPACE_URI, I18N_KEY_ATTRIBUTE);
                 }
             }
 
             currentCatalogueId = attr.getValue("", I18N_CATALOGUE_ATTRIBUTE);
             if (currentCatalogueId == null) {
                 // Try the namespaced attribute
-                currentCatalogueId = attr.getValue(I18nUtils.I18N_NAMESPACE_URI, I18N_CATALOGUE_ATTRIBUTE);
+                currentCatalogueId = attr.getValue(I18nTransformer.I18N_NAMESPACE_URI, I18N_CATALOGUE_ATTRIBUTE);
             }
 
             if (prev_state != STATE_INSIDE_PARAM) {
@@ -1519,10 +1531,10 @@
 
         // Translate all attributes from i18n:attr="name1 name2 ..."
         // using their values as keys.
-        int attrIndex = attr.getIndex(I18nUtils.I18N_NAMESPACE_URI, I18N_ATTR_ATTRIBUTE);
+        int attrIndex = attr.getIndex(I18nTransformer.I18N_NAMESPACE_URI, I18N_ATTR_ATTRIBUTE);
         if (attrIndex == -1) {
             // Try the old namespace
-            attrIndex = attr.getIndex(I18nUtils.I18N_OLD_NAMESPACE_URI, I18N_ATTR_ATTRIBUTE);
+            attrIndex = attr.getIndex(I18nTransformer.I18N_OLD_NAMESPACE_URI, I18N_ATTR_ATTRIBUTE);
         }
 
         if (attrIndex != -1) {
@@ -1556,7 +1568,7 @@
 
         // Translate all attributes from i18n:expr="name1 name2 ..."
         // using their values as keys.
-        attrIndex = attr.getIndex(I18nUtils.I18N_NAMESPACE_URI, I18N_EXPR_ATTRIBUTE);
+        attrIndex = attr.getIndex(I18nTransformer.I18N_NAMESPACE_URI, I18N_EXPR_ATTRIBUTE);
         if (attrIndex != -1) {
             StringTokenizer st = new StringTokenizer(attr.getValue(attrIndex));
 



Mime
View raw message