summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUdo Walter2020-06-30 21:22:02 +0200
committerUdo Walter2020-06-30 21:22:02 +0200
commitf6edaeb1894777eec6184fdb9c1f39768d1aa219 (patch)
treeeb3510b7ba6af925efafbcbb895d861ace8affa8
parentFallback to getIdentifier() if credential's username is null (diff)
downloadbwlp-guacamole-ext-f6edaeb1894777eec6184fdb9c1f39768d1aa219.tar.gz
bwlp-guacamole-ext-f6edaeb1894777eec6184fdb9c1f39768d1aa219.tar.xz
bwlp-guacamole-ext-f6edaeb1894777eec6184fdb9c1f39768d1aa219.zip
Add translations to German and an info text regarding the resolution
-rw-r--r--src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java6
-rw-r--r--src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java4
-rw-r--r--src/main/java/de/bwlehrpool/bwlp_guac/GroupField.java5
-rw-r--r--src/main/resources/guac-manifest.json3
-rw-r--r--src/main/resources/templates/groupField.html7
-rw-r--r--src/main/resources/translations/de.json17
-rw-r--r--src/main/resources/translations/en.json9
7 files changed, 37 insertions, 14 deletions
diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java b/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java
index 088be7f..81434f4 100644
--- a/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java
+++ b/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java
@@ -104,14 +104,14 @@ public class BwlpAuthenticationProvider implements AuthenticationProvider {
if (groupJson == null) {
throw new GuacamoleInsufficientCredentialsException(
- "Select Location", new CredentialsInfo(
+ "GROUP_SELECTION.TITLE", new CredentialsInfo(
Collections.<Field>singletonList(new GroupField())
));
}
ObjectMapper mapper = new ObjectMapper();
- String message = "Select a Location";
+ String message = "GROUP_SELECTION.TITLE";
boolean tryAgain = false;
String password = "";
@@ -132,7 +132,7 @@ public class BwlpAuthenticationProvider implements AuthenticationProvider {
if (response.groupid != 0 && correctPassword != null && !password.equals(correctPassword)) {
tryAgain = true;
- message = "Wrong password!";
+ message = "GROUP_SELECTION.PASSWORD_ERROR";
}
if (tryAgain) {
diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java b/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java
index 62b54b6..c2d155a 100644
--- a/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java
+++ b/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java
@@ -93,7 +93,7 @@ public class ConnectionManager {
if (group == null) {
// Request the user to select a group
throw new GuacamoleInsufficientCredentialsException(
- "Select Location", new CredentialsInfo(
+ "GROUP_SELECTION.TITLE", new CredentialsInfo(
Collections.<Field>singletonList(new GroupField())
));
}
@@ -122,7 +122,7 @@ public class ConnectionManager {
if (freeClient == null) {
// Request the user to select another Group
throw new GuacamoleCredentialsException(
- "No free client. Select another Location.", new CredentialsInfo(
+ "GROUP_SELECTION.NO_FREE_ERROR", new CredentialsInfo(
Collections.<Field>singletonList(new GroupField())
));
}
diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/GroupField.java b/src/main/java/de/bwlehrpool/bwlp_guac/GroupField.java
index c0f89d7..0e9c27b 100644
--- a/src/main/java/de/bwlehrpool/bwlp_guac/GroupField.java
+++ b/src/main/java/de/bwlehrpool/bwlp_guac/GroupField.java
@@ -3,11 +3,6 @@ package de.bwlehrpool.bwlp_guac;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.form.Field;
import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
import java.util.Collection;
/**
diff --git a/src/main/resources/guac-manifest.json b/src/main/resources/guac-manifest.json
index 178140b..2e301e9 100644
--- a/src/main/resources/guac-manifest.json
+++ b/src/main/resources/guac-manifest.json
@@ -8,7 +8,8 @@
"listeners" : ["de.bwlehrpool.bwlp_guac.TunnelListener"],
"html" : [ "disclaimer.html" ],
"translations" : [
- "translations/en.json"
+ "translations/en.json",
+ "translations/de.json"
],
"js" : [
"bwlp.min.js"
diff --git a/src/main/resources/templates/groupField.html b/src/main/resources/templates/groupField.html
index c2ea026..168d13b 100644
--- a/src/main/resources/templates/groupField.html
+++ b/src/main/resources/templates/groupField.html
@@ -1,3 +1,4 @@
+<div style="font-size: 0.9em; color: grey; margin: -5px 0 20px 0">{{ 'GROUP_SELECTION.RESOLUTION_INFO' | translate }}</div>
<table class="bwlp-group-container">
<tr ng-repeat="group in field.groups" class="bwlp-group"
ng-click="selectGroup($event, group.id)">
@@ -5,15 +6,15 @@
{{ group.name }}
</td>
<td class="bwlp-group-status">
- {{ group.freeCount }} available ({{ group.offlineCount }} offline)
+ {{ group.freeCount }} {{ 'GROUP_SELECTION.AVAILABLE' | translate }} ({{ group.offlineCount }} offline)
</td>
<td style="width: 200px">
<div ng-if="group.password" class="bwlp-password">
- <span ng-if="data.id !== group.id">Password protected</span>
+ <span ng-if="data.id !== group.id">{{ 'GROUP_SELECTION.PASSWORD_PROTECTED' | translate }}</span>
<input ng-if="data.id === group.id" ng-model="data.password"
type="password" placeholder="Password" class="bwlp-password-input" required>
</div>
</td>
</tr>
</table>
-<button type="button" class="logout-button" ng-click="logout()">Log out</button>
+<button type="button" class="logout-button" ng-click="logout()">{{ 'GROUP_SELECTION.LOG_OUT' | translate }}</button>
diff --git a/src/main/resources/translations/de.json b/src/main/resources/translations/de.json
new file mode 100644
index 0000000..e4212e4
--- /dev/null
+++ b/src/main/resources/translations/de.json
@@ -0,0 +1,17 @@
+{
+ "APP" : {
+ "NAME" : "bwLehrpool"
+ },
+ "LOGIN" : {
+ "FIELD_HEADER_GROUP" : ""
+ },
+ "GROUP_SELECTION" : {
+ "TITLE": "Wähle einen Raum aus",
+ "RESOLUTION_INFO": "Stelle sicher, dass das Browser Fenster die gewünschte Größe hat. Die Auflösung des Clients wird dem entsprechend gesetzt.",
+ "AVAILABLE": "verfügbar",
+ "PASSWORD_PROTECTED": "Passwortgeschützt",
+ "LOG_OUT": "Ausloggen",
+ "PASSWORD_ERROR": "Falsches Passwort!",
+ "NO_FREE_ERROR": "Keinen freien Client gefunden. Wähle einen anderen Raum aus."
+ }
+} \ No newline at end of file
diff --git a/src/main/resources/translations/en.json b/src/main/resources/translations/en.json
index 8e4fdbc..96d9b2c 100644
--- a/src/main/resources/translations/en.json
+++ b/src/main/resources/translations/en.json
@@ -4,5 +4,14 @@
},
"LOGIN" : {
"FIELD_HEADER_GROUP" : ""
+ },
+ "GROUP_SELECTION" : {
+ "TITLE": "Select a Location",
+ "RESOLUTION_INFO": "Make sure your browser window has the preferred size now. The resolution of the remote client will be set accordingly.",
+ "AVAILABLE": "available",
+ "PASSWORD_PROTECTED": "Password protected",
+ "LOG_OUT": "Log out",
+ "PASSWORD_ERROR": "Wrong password!",
+ "NO_FREE_ERROR": "No free client. Select another Location."
}
} \ No newline at end of file