Author: toad
Date: 2007-05-04 19:38:13 +0000 (Fri, 04 May 2007)
New Revision: 13152

Modified:
   trunk/freenet/src/freenet/client/InsertException.java
   trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
Log:
L10n InsertException error code strings also

Modified: trunk/freenet/src/freenet/client/InsertException.java
===================================================================
--- trunk/freenet/src/freenet/client/InsertException.java       2007-05-04 
19:31:38 UTC (rev 13151)
+++ trunk/freenet/src/freenet/client/InsertException.java       2007-05-04 
19:38:13 UTC (rev 13152)
@@ -4,6 +4,7 @@
 package freenet.client;

 import freenet.keys.FreenetURI;
+import freenet.l10n.L10n;
 import freenet.support.Logger;

 public class InsertException extends Exception {
@@ -95,61 +96,17 @@
        public static final int META_STRINGS_NOT_SUPPORTED = 11;

        public static String getMessage(int mode) {
-               switch(mode) {
-               case INVALID_URI:
-                       return "Caller supplied a URI we cannot use";
-               case BUCKET_ERROR:
-                       return "Internal bucket error: out of disk 
space/permissions problem?";
-               case INTERNAL_ERROR:
-                       return "Internal error";
-               case REJECTED_OVERLOAD:
-                       return "A downstream node timed out or was severely 
overloaded";
-               case FATAL_ERRORS_IN_BLOCKS:
-                       return "Fatal errors in a splitfile insert";
-               case TOO_MANY_RETRIES_IN_BLOCKS:
-                       return "Could not insert splitfile: ran out of retries 
(nonfatal errors)";
-               case ROUTE_NOT_FOUND:
-                       return "Could not propagate the insert to enough nodes 
(normal on small networks, try fetching it anyway)";
-               case ROUTE_REALLY_NOT_FOUND:
-                       return "Insert could not leave the node at all";
-               case COLLISION:
-                       return "Insert collided with different, pre-existing 
data at the same key";
-               case META_STRINGS_NOT_SUPPORTED:
-                       return "Meta string (most likely a '/') used in the 
URI";
-               case CANCELLED:
-                       return "Cancelled by user";
-               default:
+               String ret = L10n.getString("InsertException.longError."+mode);
+               if(ret == null)
                        return "Unknown error "+mode;
-               }
+               else return ret;
        }

        public static String getShortMessage(int mode) {
-               switch(mode) {
-               case INVALID_URI:
-                       return "Invalid URI";
-               case BUCKET_ERROR:
-                       return "Temp files error";
-               case INTERNAL_ERROR:
-                       return "Internal error";
-               case REJECTED_OVERLOAD:
-                       return "Timeout or overload";
-               case FATAL_ERRORS_IN_BLOCKS:
-                       return "Some blocks failed fatally";
-               case TOO_MANY_RETRIES_IN_BLOCKS:
-                       return "Some blocks ran out of retries";
-               case ROUTE_NOT_FOUND:
-                       return "Route not found";
-               case ROUTE_REALLY_NOT_FOUND:
-                       return "Request could not leave the node";
-               case COLLISION:
-                       return "Collided with existing data";
-               case META_STRINGS_NOT_SUPPORTED:
-                       return "Meta string used in the key";
-               case CANCELLED:
-                       return "Cancelled";
-               default:
+               String ret = L10n.getString("InsertException.shortError."+mode);
+               if(ret == null)
                        return "Unknown error "+mode;
-               }
+               else return ret;
        }

        /** Is this error fatal? Non-fatal errors are errors which are likely 
to go away with

Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
===================================================================
--- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties   2007-05-04 
19:31:38 UTC (rev 13151)
+++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties   2007-05-04 
19:38:13 UTC (rev 13152)
@@ -55,6 +55,28 @@
 FetchException.longError.27=Permanent redirect: use the new URI
 FetchException.shortError.28=All data not found
 FetchException.longError.28=Not enough data found; some data was fetched but 
redirect may point to nowhere
+InsertException.shortError.1=Invalid URI
+InsertException.longError.1=Caller supplied a URI we cannot use"
+InsertException.shortError.2=Temp files error
+InsertException.longError.2=Internal bucket error: out of disk 
space/permissions problem?
+InsertException.shortError.3=Internal error
+InsertException.longError.3=Internal error
+InsertException.shortError.4=Timeout or overload
+InsertException.longError.4=A downstream node timed out or was severely 
overloaded
+InsertException.shortError.5=Route not found
+InsertException.longError.5=Could not propagate the insert to enough nodes 
(normal on small networks, try fetching it anyway)
+InsertException.shortError.6=Some blocks failed fatally
+InsertException.longError.6=Fatal errors in a splitfile insert
+InsertException.shortError.7=Some blocks ran out of retries
+InsertException.longError.7=Could not insert splitfile: ran out of retries 
(nonfatal errors)
+InsertException.shortError.8=Request could not leave the node
+InsertException.longError.8=Insert could not leave the node at all
+InsertException.shortError.9=Collided with existing data
+InsertException.longError.9=Insert collided with different, pre-existing data 
at the same key
+InsertException.shortError.10=Cancelled
+InsertException.longError.10=Cancelled by user
+InsertException.shortError.11=Meta string used in the key
+InsertException.longError.11=Meta string (most likely a '/') used in the URI
 Toadlet.internalErrorTitle=Internal Error
 Toadlet.internalErrorPleaseReport=Internal error : please report
 Toadlet.unauthorized=You are not permitted access to this page.


Reply via email to