Use web package from utils.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / GetTranslationPage.java
index 014bc88..e0909ca 100644 (file)
@@ -18,6 +18,7 @@
 package net.pterodactylus.sone.web.ajax;
 
 import net.pterodactylus.sone.web.WebInterface;
+import net.pterodactylus.sone.web.page.FreenetRequest;
 import net.pterodactylus.util.json.JsonObject;
 
 /**
@@ -34,7 +35,7 @@ public class GetTranslationPage extends JsonPage {
         *            The Sone web interface
         */
        public GetTranslationPage(WebInterface webInterface) {
-               super("ajax/getTranslation.ajax", webInterface);
+               super("getTranslation.ajax", webInterface);
        }
 
        //
@@ -45,7 +46,7 @@ public class GetTranslationPage extends JsonPage {
         * {@inheritDoc}
         */
        @Override
-       protected JsonObject createJsonObject(Request request) {
+       protected JsonObject createJsonObject(FreenetRequest request) {
                String key = request.getHttpRequest().getParam("key");
                String translation = webInterface.getL10n().getString(key);
                return createSuccessJsonObject().put("value", translation);
@@ -59,4 +60,12 @@ public class GetTranslationPage extends JsonPage {
                return false;
        }
 
+       /**
+        * {@inheritDoc}
+        */
+       @Override
+       protected boolean requiresLogin() {
+               return false;
+       }
+
 }