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;
/**
* The Sone web interface
*/
public GetTranslationPage(WebInterface webInterface) {
- super("ajax/getTranslation.ajax", webInterface);
+ super("getTranslation.ajax", webInterface);
}
//
* {@inheritDoc}
*/
@Override
- protected JsonObject createJsonObject(Request request) {
+ protected JsonObject createJsonObject(FreenetRequest request) {
String key = request.getHttpRequest().getParam("key");
- String translation = webInterface.l10n().getString(key);
- return new JsonObject().put("value", translation);
+ String translation = webInterface.getL10n().getString(key);
+ return createSuccessJsonObject().put("value", translation);
}
/**
return false;
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean requiresLogin() {
+ return false;
+ }
+
}