Author: toad
Date: 2007-04-28 19:13:58 +0000 (Sat, 28 Apr 2007)
New Revision: 13040

Modified:
   trunk/freenet/src/freenet/clients/http/StaticToadlet.java
   trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
Log:
More keys

Modified: trunk/freenet/src/freenet/clients/http/StaticToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/StaticToadlet.java   2007-04-28 
19:09:50 UTC (rev 13039)
+++ trunk/freenet/src/freenet/clients/http/StaticToadlet.java   2007-04-28 
19:13:58 UTC (rev 13040)
@@ -7,6 +7,7 @@

 import freenet.client.DefaultMIMETypes;
 import freenet.client.HighLevelSimpleClient;
+import freenet.l10n.L10n;
 import freenet.support.api.Bucket;
 import freenet.support.api.HTTPRequest;

@@ -32,19 +33,19 @@
                try {
                        path = path.substring(ROOT_URL.length());
                } catch (IndexOutOfBoundsException ioobe) {
-                       this.sendErrorPage(ctx, 404, "Path not found", "The 
path you specified doesn't exist");
+                       this.sendErrorPage(ctx, 404, l10n("pathNotFoundTitle"), 
l10n("pathNotFound"));
                        return;
                }

                // be very strict about what characters we allow in the path, 
since
                if (!path.matches("^[A-Za-z0-9\\._\\/\\-]*$") || 
(path.indexOf("..") != -1)) {
-                       this.sendErrorPage(ctx, 404, "Path not found", "The 
given URI contains disallowed characters.");
+                       this.sendErrorPage(ctx, 404, l10n("pathNotFoundTitle"), 
l10n("pathInvalidChars"));
                        return;
                }

                InputStream strm = 
getClass().getResourceAsStream(ROOT_PATH+path);
                if (strm == null) {
-                       this.sendErrorPage(ctx, 404, "Path not found", "The 
specified path does not exist.");
+                       this.sendErrorPage(ctx, 404, l10n("pathNotFoundTitle"), 
l10n("pathNotFound"));
                        return;
                }
                Bucket data = 
ctx.getBucketFactory().makeBucket(strm.available());
@@ -64,6 +65,10 @@
                data.free();
        }

+       private String l10n(String key) {
+               return L10n.getString("StaticToadlet."+key);
+       }
+
        public String supportedMethods() {
                return "GET";
        }

Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
===================================================================
--- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties   2007-04-28 
19:09:50 UTC (rev 13039)
+++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties   2007-04-28 
19:13:58 UTC (rev 13040)
@@ -351,6 +351,9 @@
 QueueToadlet.errorDownloadNotFoundExplanation=The download could not be found. 
Maybe it was already deleted?
 QueueToadlet.warningUnsafeContent=Potentially Unsafe Content
 QueueToadlet.warningUnsafeContentExplanation=The file you want to download is 
currently not filtered by Freenet's content filter! That means that your 
anonymity can be compromised by opening the file!
+StaticToadlet.pathNotFoundTitle=Path Not Found
+StaticToadlet.pathNotFound=The path you specified doesn't exist.
+StaticToadlet.pathInvalidChars=The given URI contains disallowed characters.
 FcpServer.isEnabled=Is FCP server enabled ?
 FcpServer.isEnabledLong=Is FCP server enabled ?
 FcpServer.portNumber=FCP port number


Reply via email to