Author: toad
Date: 2007-05-04 19:30:30 +0000 (Fri, 04 May 2007)
New Revision: 13150
Modified:
trunk/freenet/src/freenet/client/FetchException.java
trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
Log:
Localise FetchException error code strings
Modified: trunk/freenet/src/freenet/client/FetchException.java
===================================================================
--- trunk/freenet/src/freenet/client/FetchException.java 2007-05-04
19:17:11 UTC (rev 13149)
+++ trunk/freenet/src/freenet/client/FetchException.java 2007-05-04
19:30:30 UTC (rev 13150)
@@ -4,6 +4,7 @@
package freenet.client;
import freenet.keys.FreenetURI;
+import freenet.l10n.L10n;
import freenet.support.Logger;
/**
@@ -182,66 +183,10 @@
}
public static String getShortMessage(int mode) {
- switch(mode) {
- case TOO_DEEP_ARCHIVE_RECURSION:
- return "Too deep archive recursion";
- case UNKNOWN_SPLITFILE_METADATA:
- return "Unknown splitfile metadata";
- case TOO_MANY_REDIRECTS:
- return "Too many redirects";
- case UNKNOWN_METADATA:
- return "Unknown metadata";
- case INVALID_METADATA:
- return "Invalid metadata";
- case ARCHIVE_FAILURE:
- return "Archive failure";
- case BLOCK_DECODE_ERROR:
- return "Block decode error";
- case TOO_MANY_METADATA_LEVELS:
- return "Too many metadata levels";
- case TOO_MANY_ARCHIVE_RESTARTS:
- return "Too many archive restarts";
- case TOO_MUCH_RECURSION:
- return "Too much recursion";
- case NOT_IN_ARCHIVE:
- return "Not in archive";
- case TOO_MANY_PATH_COMPONENTS:
- return "Too many path components";
- case BUCKET_ERROR:
- return "Temporary files error";
- case DATA_NOT_FOUND:
- return "Data not found";
- case ALL_DATA_NOT_FOUND:
- return "All data not found";
- case ROUTE_NOT_FOUND:
- return "Route not found";
- case REJECTED_OVERLOAD:
- return "Timeout or overload";
- case INTERNAL_ERROR:
- return "Internal error";
- case TRANSFER_FAILED:
- return "Transfer failed";
- case SPLITFILE_ERROR:
- return "Splitfile error";
- case INVALID_URI:
- return "Invalid URI";
- case TOO_BIG:
- return "Too big";
- case TOO_BIG_METADATA:
- return "Metadata too big";
- case TOO_MANY_BLOCKS_PER_SEGMENT:
- return "Too many blocks per segment";
- case NOT_ENOUGH_PATH_COMPONENTS:
- return "Not enough meta-strings"; // FIXME better
description
- case CANCELLED:
- return "Cancelled";
- case ARCHIVE_RESTART:
- return "Archive restarted";
- case PERMANENT_REDIRECT:
- return "New URI";
- default:
+ String ret = L10n.getString("FetchException.shortError."+mode);
+ if(ret == null)
return "Unknown code "+mode;
- }
+ else return ret;
}
public String toString() {
@@ -264,67 +209,10 @@
}
public static String getMessage(int mode) {
- switch(mode) {
- case TOO_DEEP_ARCHIVE_RECURSION:
- return "Too many levels of recursion into archives";
- case UNKNOWN_SPLITFILE_METADATA:
- return "Don't know what to do with splitfile";
- case TOO_MANY_REDIRECTS:
- return "Too many redirects - loop?";
- case UNKNOWN_METADATA:
- return "Don't know what to do with metadata";
- case INVALID_METADATA:
- return "Failed to parse metadata";
- case ARCHIVE_FAILURE:
- return "Failure in extracting files from an archive";
- case BLOCK_DECODE_ERROR:
- return "Failed to decode a block";
- case TOO_MANY_METADATA_LEVELS:
- return "Too many levels of split metadata";
- case TOO_MANY_ARCHIVE_RESTARTS:
- return "Request was restarted too many times due to
archives changing";
- case TOO_MUCH_RECURSION:
- return "Too many redirects (too much recursion)"; //
FIXME: ???
- case NOT_IN_ARCHIVE:
- return "File not in archive";
- case TOO_MANY_PATH_COMPONENTS:
- return "Too many path components - not a manifest? Try
removing one";
- case BUCKET_ERROR:
- return "Internal temp files error, maybe disk full or
permissions problem?";
- case DATA_NOT_FOUND:
- return "Data not found";
- case ALL_DATA_NOT_FOUND:
- return "Not enough data found; some data was fetched
but redirect may point to nowhere";
- case ROUTE_NOT_FOUND:
- return "Route not found - could not find enough nodes
to be sure the data doesn't exist";
- case REJECTED_OVERLOAD:
- return "A node was overloaded or timed out";
- case INTERNAL_ERROR:
- return "Internal error, probably a bug";
- case TRANSFER_FAILED:
- return "Found the file, but lost it while receiving the
data";
- case SPLITFILE_ERROR:
- return "Splitfile error";
- case INVALID_URI:
- return "Invalid URI";
- case TOO_BIG:
- return "Too big";
- case TOO_BIG_METADATA:
- return "Metadata too big";
- case TOO_MANY_BLOCKS_PER_SEGMENT:
- return "Too many blocks per segment";
- case NOT_ENOUGH_PATH_COMPONENTS:
- return "Give more metastrings (path components) in URI";
- // FIXME better description for above
- case CANCELLED:
- return "Cancelled by caller";
- case ARCHIVE_RESTART:
- return "Archive restarted";
- case PERMANENT_REDIRECT:
- return "Permanent redirect: use the new URI";
- default:
+ String ret = L10n.getString("FetchException.longError."+mode);
+ if(ret == null)
return "Unknown fetch error code: "+mode;
- }
+ else return ret;
}
// FIXME many of these are not used any more
Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
===================================================================
--- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2007-05-04
19:17:11 UTC (rev 13149)
+++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2007-05-04
19:30:30 UTC (rev 13150)
@@ -1,4 +1,60 @@
testing.test=test$(test1)test$(test2)test
+FetchException.shortError.1=Too deep archive recursion
+FetchException.longError.1=Too many levels of recursion into archives
+FetchException.shortError.2=Unknown splitfile metadata
+FetchException.longError.2=Don't know what to do with splitfile
+FetchException.shortError.3=Unknown metadata
+FetchException.longError.3=Don't know what to do with metadata
+FetchException.shortError.4=Invalid metadata
+FetchException.longError.4=Failed to parse metadata
+FetchException.shortError.5=Archive failure
+FetchException.longError.5=Failure in extracting files from an archive
+FetchException.shortError.6=Block decode error
+FetchException.longError.6=Failed to decode a block
+FetchException.shortError.7=Too many metadata levels
+FetchException.longError.7=Too many levels of split metadata
+FetchException.shortError.8=Too many archive restarts
+FetchException.longError.8=Request was restarted too many times due to
archives changing
+FetchException.shortError.9=Too much recursion
+FetchException.longError.9=Too many redirects (too much recursion)
+FetchException.shortError.10=Not in archive
+FetchException.longError.10=File not in archive
+FetchException.shortError.11=Too many path components
+FetchException.longError.11=Too many path components - not a manifest? Try
removing one
+FetchException.shortError.12=Temporary files error
+FetchException.longError.12=Internal temp files error, maybe disk full or
permissions problem?
+FetchException.shortError.13=Data not found
+FetchException.longError.13=Data not found
+FetchException.shortError.14=Route not found
+FetchException.longError.14=Route not found - could not find enough nodes to
be sure the data doesn't exist
+FetchException.shortError.15=Timeout or overload
+FetchException.longError.15=A node was overloaded or timed out
+FetchException.shortError.16=Too many redirects
+FetchException.longError.16=Too many redirects - loop?
+FetchException.shortError.17=Internal error
+FetchException.longError.17=Internal error, probably a bug
+FetchException.shortError.18=Transfer failed
+FetchException.longError.18=Found the file, but lost it while receiving the
data
+FetchException.shortError.19=Splitfile error
+FetchException.longError.19=Splitfile error
+FetchException.shortError.20=Invalid URI
+FetchException.longError.20=Invalid URI
+FetchException.shortError.21=Too big
+FetchException.longError.21=Too big
+FetchException.shortError.22=Metadata too big
+FetchException.longError.22=Metadata too big
+FetchException.shortError.23=Too many blocks per segment
+FetchException.longError.23=Too many blocks per segment
+FetchException.shortError.24=Not enough meta-strings
+FetchException.longError.24=Give more metastrings (path components) in URI
+FetchException.shortError.25=Cancelled by caller
+FetchException.longError.25=Cancelled
+FetchException.shortError.26=Archive restarted
+FetchException.longError.26=Archive restarted
+FetchException.shortError.27=New URI
+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
Toadlet.internalErrorTitle=Internal Error
Toadlet.internalErrorPleaseReport=Internal error : please report
Toadlet.unauthorized=You are not permitted access to this page.