directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r902331 - in /directory/apacheds/trunk: i18n/src/main/resources/org/apache/directory/server/i18n/ protocol-changepw/src/main/java/org/apache/directory/server/changepw/exceptions/ protocol-changepw/src/main/java/org/apache/directory/server/c...
Date Sat, 23 Jan 2010 01:41:36 GMT
Author: felixk
Date: Sat Jan 23 01:41:35 2010
New Revision: 902331

URL: http://svn.apache.org/viewvc?rev=902331&view=rev
Log:
I18n

Modified:
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/exceptions/ErrorType.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpDecoder.java
    directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageDecoder.java
    directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageEncoder.java
    directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/HardwareAddress.java
    directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/AddressOption.java
    directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/DhcpOption.java
    directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/StringOption.java

Modified: directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties?rev=902331&r1=902330&r2=902331&view=diff
==============================================================================
--- directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties
(original)
+++ directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties
Sat Jan 23 01:41:35 2010
@@ -655,15 +655,15 @@
 ERR_631=The specified configuration dir {0} doesn't exist under {1}
 ERR_632=The expected context entry does not exist
 ERR_633=The entry already exists
-ERR_634=
-ERR_635=
-ERR_636=
-ERR_637=
-ERR_638=
-ERR_639=
-ERR_640=
-ERR_641=
-ERR_642=
+ERR_634=maxObjectSize: {0}
+ERR_635=No ASCII encoding
+ERR_636=Can't set option value: {0}
+ERR_637=Can't parse string representation: {0}
+ERR_638=illegal address
+ERR_639=Class {0} is not a descendant of DhcpOption
+ERR_640=Can't initialize option field classes
+ERR_641=Max data length: 128 bytes.
+ERR_642=ASCII encoding unavailable
 ERR_643=
 ERR_644=
 ERR_645=

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/exceptions/ErrorType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/exceptions/ErrorType.java?rev=902331&r1=902330&r2=902331&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/exceptions/ErrorType.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/exceptions/ErrorType.java
Sat Jan 23 01:41:35 2010
@@ -34,6 +34,9 @@
  */
 public final class ErrorType implements Comparable<ErrorType>
 {
+    // TODO Add i18n. Don't no if these error messages are also a response to the client.
+    // If so shall they really be i18n?
+
     /**
      * Constant for the "Request failed due to being malformed" error type.
      */

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpDecoder.java?rev=902331&r1=902330&r2=902331&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpDecoder.java
Sat Jan 23 01:41:35 2010
@@ -22,6 +22,7 @@
 
 
 import org.apache.directory.server.changepw.io.ChangePasswordRequestDecoder;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.mina.core.buffer.IoBuffer;
 import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
@@ -65,7 +66,7 @@
     {
         if ( maxObjectSize <= 0 )
         {
-            throw new IllegalArgumentException( "maxObjectSize: " + maxObjectSize );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_634, maxObjectSize ) );
         }
 
         this.maxObjectSize = maxObjectSize;

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageDecoder.java?rev=902331&r1=902330&r2=902331&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageDecoder.java
Sat Jan 23 01:41:35 2010
@@ -34,6 +34,7 @@
 import org.apache.directory.server.dhcp.options.OptionsField;
 import org.apache.directory.server.dhcp.options.dhcp.DhcpMessageType;
 import org.apache.directory.server.dhcp.options.dhcp.UnrecognizedOption;
+import org.apache.directory.server.i18n.I18n;
 
 
 /**
@@ -114,7 +115,7 @@
         }
         catch ( UnsupportedEncodingException e )
         {
-            throw new RuntimeException( "No ASCII encoding", e );
+            throw new RuntimeException( I18n.err( I18n.ERR_635 ), e );
         }
     }
 
@@ -194,7 +195,7 @@
         }
         catch ( Exception e )
         {
-            throw new DhcpException( "Can't set option value: " + e.toString() );
+            throw new DhcpException( I18n.err( I18n.ERR_636, e.toString() ) );
         }
     }
 }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageEncoder.java?rev=902331&r1=902330&r2=902331&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageEncoder.java
Sat Jan 23 01:41:35 2010
@@ -31,6 +31,7 @@
 import org.apache.directory.server.dhcp.options.DhcpOption;
 import org.apache.directory.server.dhcp.options.OptionsField;
 import org.apache.directory.server.dhcp.options.dhcp.DhcpMessageType;
+import org.apache.directory.server.i18n.I18n;
 
 
 /**
@@ -102,7 +103,7 @@
         catch ( UnsupportedEncodingException e )
         {
             // should not happen
-            throw new RuntimeException( "No ASCII encoding", e );
+            throw new RuntimeException( I18n.err( I18n.ERR_635 ), e );
         }
     }
 

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/HardwareAddress.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/HardwareAddress.java?rev=902331&r1=902330&r2=902331&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/HardwareAddress.java
(original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/HardwareAddress.java
Sat Jan 23 01:41:35 2010
@@ -25,6 +25,8 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.directory.server.i18n.I18n;
+
 
 /**
  * A representation of a DHCP hardware address.
@@ -189,7 +191,7 @@
 
         Matcher m = PARSE_PATTERN.matcher( s );
         if ( !m.matches() )
-            throw new IllegalArgumentException( "Can't parse string representation: " + s
);
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_637, s ) );
 
         int type = Integer.parseInt( m.group( 1 ) );
         int len = m.groupCount() - 1;

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/AddressOption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/AddressOption.java?rev=902331&r1=902330&r2=902331&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/AddressOption.java
(original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/AddressOption.java
Sat Jan 23 01:41:35 2010
@@ -24,6 +24,8 @@
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 
+import org.apache.directory.server.i18n.I18n;
+
 
 /**
  * The Dynamic Host Configuration Protocol (DHCP) provides a framework
@@ -62,7 +64,7 @@
         }
         catch ( UnknownHostException e )
         {
-            throw new IllegalArgumentException( "illegal address", e );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_638 ), e );
         }
     }
 

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/DhcpOption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/DhcpOption.java?rev=902331&r1=902330&r2=902331&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/DhcpOption.java
(original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/DhcpOption.java
Sat Jan 23 01:41:35 2010
@@ -94,6 +94,7 @@
 import org.apache.directory.server.dhcp.options.vendor.SwapServer;
 import org.apache.directory.server.dhcp.options.vendor.TimeOffset;
 import org.apache.directory.server.dhcp.options.vendor.TimeServers;
+import org.apache.directory.server.i18n.I18n;
 
 
 /**
@@ -156,7 +157,7 @@
                 Class c = OPTION_CLASSES[i];
 
                 if ( !DhcpOption.class.isAssignableFrom( c ) )
-                    throw new RuntimeException( "Class " + c + " is not a descendant of DhcpOption"
);
+                    throw new RuntimeException( I18n.err( I18n.ERR_639, c ) );
 
                 DhcpOption o = ( DhcpOption ) c.newInstance();
 
@@ -170,7 +171,7 @@
         }
         catch ( Exception e )
         {
-            throw new RuntimeException( "Can't initialize option field classes", e );
+            throw new RuntimeException( I18n.err( I18n.ERR_640 ), e );
         }
     }
 
@@ -233,7 +234,7 @@
         // FIXME: handle continuation, i.e. options longer than 128 bytes?
         byte data[] = getData();
         if ( data.length > 255 )
-            throw new IllegalArgumentException( "Max data length: 128 bytes." );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_641 ) );
 
         out.put( ( byte ) data.length );
         out.put( data );

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/StringOption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/StringOption.java?rev=902331&r1=902330&r2=902331&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/StringOption.java
(original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/StringOption.java
Sat Jan 23 01:41:35 2010
@@ -23,6 +23,8 @@
 
 import java.io.UnsupportedEncodingException;
 
+import org.apache.directory.server.i18n.I18n;
+
 
 /**
  * The Dynamic Host Configuration Protocol (DHCP) provides a framework for
@@ -54,7 +56,7 @@
         catch ( UnsupportedEncodingException e )
         {
             // should not happen
-            throw new RuntimeException( "ASCII encoding unavailable" );
+            throw new RuntimeException( I18n.err( I18n.ERR_642 ) );
         }
     }
 
@@ -75,7 +77,7 @@
         catch ( UnsupportedEncodingException e )
         {
             // should not happen
-            throw new RuntimeException( "ASCII encoding unavailable" );
+            throw new RuntimeException( I18n.err( I18n.ERR_642 ) );
         }
     }
 



Mime
View raw message