projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace view Sone page with Kotlin version
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
ajax
/
GetTranslationPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/ajax/GetTranslationPage.java
b/src/main/java/net/pterodactylus/sone/web/ajax/GetTranslationPage.java
index
68f1777
..
53e3e67
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/GetTranslationPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/GetTranslationPage.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - GetTranslationPage.java - Copyright © 2010 David Roden
+ * Sone - GetTranslationPage.java - Copyright © 2010
–2016
David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-18,7
+18,7
@@
package net.pterodactylus.sone.web.ajax;
import net.pterodactylus.sone.web.WebInterface;
package net.pterodactylus.sone.web.ajax;
import net.pterodactylus.sone.web.WebInterface;
-import net.pterodactylus.
util.json.JsonObjec
t;
+import net.pterodactylus.
sone.web.page.FreenetReques
t;
/**
* Returns the translation for a given key as JSON object.
/**
* Returns the translation for a given key as JSON object.
@@
-34,7
+34,7
@@
public class GetTranslationPage extends JsonPage {
* The Sone web interface
*/
public GetTranslationPage(WebInterface webInterface) {
* The Sone web interface
*/
public GetTranslationPage(WebInterface webInterface) {
- super("
ajax/
getTranslation.ajax", webInterface);
+ super("getTranslation.ajax", webInterface);
}
//
}
//
@@
-45,10
+45,10
@@
public class GetTranslationPage extends JsonPage {
* {@inheritDoc}
*/
@Override
* {@inheritDoc}
*/
@Override
- protected Json
Object createJsonObject(
Request request) {
+ protected Json
ReturnObject createJsonObject(Freenet
Request request) {
String key = request.getHttpRequest().getParam("key");
String key = request.getHttpRequest().getParam("key");
- String translation = webInterface.
l
10n().getString(key);
- return
new
JsonObject().put("value", translation);
+ String translation = webInterface.
getL
10n().getString(key);
+ return
createSuccess
JsonObject().put("value", translation);
}
/**
}
/**
@@
-59,4
+59,12
@@
public class GetTranslationPage extends JsonPage {
return false;
}
return false;
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean requiresLogin() {
+ return false;
+ }
+
}
}