summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java
diff options
context:
space:
mode:
authorMürsel Türk2020-07-07 12:02:55 +0200
committerMürsel Türk2020-07-07 12:02:55 +0200
commitde374cea11032e8ea839ee349d7d68a68ffdea70 (patch)
treed30db205733d28004d2bdc7faa59f897e6f28460 /dozentenmodul/src/main/java
parent[client] Add resource bundle files for activity classes. Update the activity ... (diff)
downloadtutor-module-de374cea11032e8ea839ee349d7d68a68ffdea70.tar.gz
tutor-module-de374cea11032e8ea839ee349d7d68a68ffdea70.tar.xz
tutor-module-de374cea11032e8ea839ee349d7d68a68ffdea70.zip
[client] Add resource bundle files for configurator classes. Update the configurator classes accordingly.
Diffstat (limited to 'dozentenmodul/src/main/java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ImagePermissionConfigurator.java7
-rwxr-xr-xdozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java30
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LecturePermissionConfigurator.java7
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java71
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java54
-rwxr-xr-xdozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/StartupConfigurator.java39
6 files changed, 103 insertions, 105 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ImagePermissionConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ImagePermissionConfigurator.java
index efba020c..cf082e27 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ImagePermissionConfigurator.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ImagePermissionConfigurator.java
@@ -33,6 +33,7 @@ import org.openslx.dozmod.gui.control.table.ImagePermissionTable;
import org.openslx.dozmod.gui.control.table.ImagePermissionTable.UserImagePermissions;
import org.openslx.dozmod.gui.control.table.QScrollPane;
import org.openslx.dozmod.gui.helper.GridManager;
+import org.openslx.dozmod.gui.helper.I18n;
import org.openslx.dozmod.gui.window.UserListWindow;
import org.openslx.dozmod.gui.window.UserListWindow.UserAddedCallback;
import org.openslx.dozmod.thrift.cache.UserCache;
@@ -69,9 +70,9 @@ public class ImagePermissionConfigurator extends JPanel implements GenericContro
userButtonPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
userButtonPane.setLayout(new BoxLayout(userButtonPane, BoxLayout.LINE_AXIS));
- btnAddUser = new JButton("Benutzer hinzufügen");
+ btnAddUser = new JButton(I18n.CONFIGURATOR.getString("ImagePermission.Button.addUser.text"));
userButtonPane.add(btnAddUser);
- btnRemoveUser = new JButton("Benutzer entfernen");
+ btnRemoveUser = new JButton(I18n.CONFIGURATOR.getString("ImagePermission.Button.removeUser.text"));
userButtonPane.add(btnRemoveUser);
userButtonPane.add(Box.createGlue());
@@ -105,7 +106,7 @@ public class ImagePermissionConfigurator extends JPanel implements GenericContro
permissionTable.setData(permissionList, false);
fireUserChangeEvent();
}
- }, "Hinzufügen", ownerId);
+ }, I18n.CONFIGURATOR.getString("ImagePermission.Button.addUser.caption"), ownerId);
}
});
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java
index 15959322..817289be 100755
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java
@@ -29,6 +29,7 @@ import org.openslx.dozmod.gui.control.table.CheckListTable.Wrapper;
import org.openslx.dozmod.gui.control.table.LectureLdapFilterTable;
import org.openslx.dozmod.gui.control.table.QScrollPane;
import org.openslx.dozmod.gui.helper.GridManager;
+import org.openslx.dozmod.gui.helper.I18n;
import org.openslx.dozmod.gui.helper.MessageType;
import org.openslx.dozmod.thrift.cache.MetaDataCache;
@@ -63,7 +64,7 @@ public class LdapFilterConfigurator extends LdapFilterConfiguratorLayout {
txtAttribute.setEnabled(editable);
txtValue.setEnabled(editable);
if (editable)
- btnAdd.setText("Ändern");
+ btnAdd.setText(I18n.CONFIGURATOR.getString("LdapFilter.Button.add.text.0"));
if (item == null) {
clearInputFields();
return;
@@ -82,7 +83,8 @@ public class LdapFilterConfigurator extends LdapFilterConfiguratorLayout {
LdapFilter input = new LdapFilter();
input.attribute = txtAttribute.getText();
if (input.attribute == null || input.attribute.isEmpty()) {
- Gui.showMessageBox("Kein Attribut angegeben", MessageType.ERROR, null, null);
+ Gui.showMessageBox(I18n.CONFIGURATOR.getString("LdapFilter.Message.error.noAttribute"),
+ MessageType.ERROR, null, null);
return;
}
input.value = txtValue.getText();
@@ -97,7 +99,8 @@ public class LdapFilterConfigurator extends LdapFilterConfiguratorLayout {
// creating a new one, either way add it to the list and update
// the table, if its not present already
if (oldList.contains(newEntry)) {
- Gui.showMessageBox("Eintrag bereits vorhanden", MessageType.ERROR, null, null);
+ Gui.showMessageBox(I18n.CONFIGURATOR.getString("LdapFilter.Message.error.entryAlreadyExists"),
+ MessageType.ERROR, null, null);
return;
}
// now decide whether to create a new entry or update existing one
@@ -143,7 +146,7 @@ public class LdapFilterConfigurator extends LdapFilterConfiguratorLayout {
btnDel.setEnabled(false);
txtAttribute.setText(null);
txtValue.setText(null);
- btnAdd.setText("Hinzufügen");
+ btnAdd.setText(I18n.CONFIGURATOR.getString("LdapFilter.Button.add.text.1"));
}
public List<LdapFilter> getState() {
@@ -205,11 +208,6 @@ class LdapFilterConfiguratorLayout extends JPanel {
private static final long serialVersionUID = 6479838641542743622L;
- private final static String HELPTEXT = "Geben Sie hier LDAP Filter ein, die die Sichtbarkeit"
- + " der Veranstaltung abhängig vom angemeldeten Benutzer einschränken. Eine Veranstaltung"
- + " ist sichtbar, sobald einer der angegebenen Filter zutrifft. Zusätzliche Raumbeschränkungen"
- + " greifen weiterhin.";
-
protected final LectureLdapFilterTable tblFilters = new LectureLdapFilterTable();
protected final JTextField txtAttribute, txtValue;
protected final JButton btnAdd, btnDel;
@@ -217,27 +215,29 @@ class LdapFilterConfiguratorLayout extends JPanel {
public LdapFilterConfiguratorLayout() {
GridManager grid = new GridManager(this, 1, true, new Insets(3, 3, 3, 3));
// top info panel
- grid.add(new WordWrapLabel(HELPTEXT)).fill(true, false).expand(true, false);
+ grid.add(new WordWrapLabel(I18n.CONFIGURATOR.getString("LdapFilter.Label.info.text")))
+ .fill(true, false).expand(true, false);
grid.nextRow();
// middle filter list
grid.add(new QScrollPane(tblFilters)).fill(true, true).expand(true, true);
grid.nextRow();
- btnDel = new JButton("Entfernen");
+ btnDel = new JButton(I18n.CONFIGURATOR.getString("LdapFilter.Button.delete.text"));
grid.add(btnDel).anchor(GridBagConstraints.EAST);
grid.nextRow();
JPanel pnlNewShare = new JPanel();
GridManager gridNewFilter = new GridManager(pnlNewShare, 3, true);
- pnlNewShare.setBorder(BorderFactory.createTitledBorder("Eigene Filter definieren"));
- gridNewFilter.add(new QLabel("Attribut"));
+ pnlNewShare.setBorder(BorderFactory.createTitledBorder(
+ I18n.CONFIGURATOR.getString("LdapFilter.TitledBorder.newShare.title")));
+ gridNewFilter.add(new QLabel(I18n.CONFIGURATOR.getString("LdapFilter.Label.attribute.text")));
txtAttribute = new JTextField();
gridNewFilter.add(txtAttribute, 2).fill(true, false).expand(true, false);
gridNewFilter.nextRow();
- gridNewFilter.add(new QLabel("Wert"));
+ gridNewFilter.add(new QLabel(I18n.CONFIGURATOR.getString("LdapFilter.Label.value.text")));
txtValue = new JTextField();
gridNewFilter.add(txtValue).fill(true, false).expand(true, false);
- btnAdd = new JButton("Hinzufügen");
+ btnAdd = new JButton(I18n.CONFIGURATOR.getString("LdapFilter.Button.add.text.1"));
gridNewFilter.add(btnAdd).anchor(GridBagConstraints.EAST);
gridNewFilter.nextRow();
gridNewFilter.finish(false);
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LecturePermissionConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LecturePermissionConfigurator.java
index 5e4c1649..b659c3c9 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LecturePermissionConfigurator.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LecturePermissionConfigurator.java
@@ -31,6 +31,7 @@ import org.openslx.dozmod.gui.control.table.LecturePermissionTable;
import org.openslx.dozmod.gui.control.table.LecturePermissionTable.UserLecturePermissions;
import org.openslx.dozmod.gui.control.table.QScrollPane;
import org.openslx.dozmod.gui.helper.GridManager;
+import org.openslx.dozmod.gui.helper.I18n;
import org.openslx.dozmod.gui.window.UserListWindow;
import org.openslx.dozmod.gui.window.UserListWindow.UserAddedCallback;
@@ -76,9 +77,9 @@ public class LecturePermissionConfigurator extends JPanel implements GenericCont
userButtonPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
userButtonPane.setLayout(new BoxLayout(userButtonPane, BoxLayout.LINE_AXIS));
- btnAddUser = new JButton("Benutzer hinzufügen");
+ btnAddUser = new JButton(I18n.CONFIGURATOR.getString("LecturePermission.Button.addUser.text"));
userButtonPane.add(btnAddUser);
- btnRemoveUser = new JButton("Benutzer entfernen");
+ btnRemoveUser = new JButton(I18n.CONFIGURATOR.getString("LecturePermission.Button.removeUser.text"));
userButtonPane.add(btnRemoveUser);
userButtonPane.add(Box.createGlue());
@@ -111,7 +112,7 @@ public class LecturePermissionConfigurator extends JPanel implements GenericCont
permissionTable.setData(permissionList, false);
fireUserChangeEvent();
}
- }, "Hinzufügen", ownerId);
+ }, I18n.CONFIGURATOR.getString("LecturePermission.Button.addUser.caption"), ownerId);
}
});
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java
index 3a0aabdd..8e11e484 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java
@@ -51,6 +51,7 @@ import org.openslx.dozmod.gui.changemonitor.GenericControlWindow;
import org.openslx.dozmod.gui.configurator.NetrulesConfigurator.StateWrapper;
import org.openslx.dozmod.gui.control.WordWrapLabel;
import org.openslx.dozmod.gui.helper.GridManager;
+import org.openslx.dozmod.gui.helper.I18n;
import org.openslx.dozmod.gui.helper.MessageType;
import org.openslx.dozmod.gui.helper.TextChangeListener;
import org.openslx.dozmod.thrift.cache.MetaDataCache;
@@ -196,11 +197,13 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
private void showPresetSelector() {
if (predefinedRules == null) {
- Gui.showMessageBox("Wah wah wah! Null preset list", MessageType.ERROR, null, null);
+ Gui.showMessageBox(I18n.CONFIGURATOR.getString("NetRules.Message.error.noPredefinedRules"),
+ MessageType.ERROR, null, null);
return;
}
final JDialog dialog = new JDialog(SwingUtilities.getWindowAncestor(this),
- "Auswahl", ModalityType.APPLICATION_MODAL);
+ I18n.CONFIGURATOR.getString("NetRules.Dialog.dialog.title"),
+ ModalityType.APPLICATION_MODAL);
JPanel pane = new JPanel();
pane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "cancel");
@@ -216,7 +219,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
dialog.setMinimumSize(dd);
dialog.setPreferredSize(dd);
GridManager grid = new GridManager(pane, 3, true, new Insets(2, 2, 2, 2));
- grid.add(new WordWrapLabel("Vordefinierte Regelsets:"), 3);
+ grid.add(new WordWrapLabel(I18n.CONFIGURATOR.getString("NetRules.Label.predefinedRules.text")), 3);
grid.nextRow();
final Map<ButtonModel, Integer> mapper = new HashMap<>();
for (PresetNetRule ruleSet : predefinedRules) {
@@ -231,8 +234,8 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
grid.add(Box.createVerticalGlue(), 3).expand(true, true).fill(true, true);
grid.nextRow();
grid.add(Box.createHorizontalGlue()).expand(true, false).fill(true, false);
- JButton btnCancel = new JButton("Abbrechen");
- JButton btnOk = new JButton("Speichern");
+ JButton btnCancel = new JButton(I18n.CONFIGURATOR.getString("NetRules.Button.cancel.text"));
+ JButton btnOk = new JButton(I18n.CONFIGURATOR.getString("NetRules.Button.ok.text"));
grid.add(btnCancel);
grid.add(btnOk);
grid.finish(false);
@@ -386,9 +389,9 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
// log numbers for fields independently...
LOGGER.debug("Invalid number of fields! Expected 3, got: " + fields.length);
if (fields.length > 3) {
- errors.append("Zeile " + lineNo + ": Zu viele Felder.\n");
+ errors.append(I18n.CONFIGURATOR.getString("NetRules.Message.error.tooManyFields", lineNo));
} else {
- errors.append("Zeile " + lineNo + ": Zu wenig Felder.\n");
+ errors.append(I18n.CONFIGURATOR.getString("NetRules.Message.error.tooFewFields", lineNo));
}
invalid = true;
continue;
@@ -404,7 +407,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
if (!ruleDirection.equals("IN") && !ruleDirection.equals("OUT")) {
lineNo += addLine(newdoc, ruleLine, Color.RED, true);
LOGGER.debug("Invalid net direction! Expected 'in' or out'. Got: " + ruleDirection);
- errors.append("Zeile " + lineNo + ": Ungültige Richtung. Bitte nutzen Sie 'IN' bzw. 'OUT'.\n");
+ errors.append(I18n.CONFIGURATOR.getString("NetRules.Message.error.invalidNetDirection", lineNo));
invalid = true;
continue;
}
@@ -415,7 +418,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
if (port < 0 || port > 65535) {
lineNo += addLine(newdoc, ruleLine, Color.RED, true);
LOGGER.debug("Invalid port! Got: " + port);
- errors.append("Zeile " + lineNo + ": Ungültiger Port. Gültiger Bereich ist 0-65535.\n");
+ errors.append(I18n.CONFIGURATOR.getString("NetRules.Message.error.invalidPort", lineNo));
invalid = true;
continue;
}
@@ -429,7 +432,8 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
String checkRes = checkHostnameSimple(fields[0]);
if (checkRes != null) {
lineNo += addLine(newdoc, ruleLine, Color.RED, true);
- errors.append("Zeile " + lineNo + ": " + checkRes + "\n");
+ errors.append(I18n.CONFIGURATOR.getString("NetRules.Message.error.checkResWithLineNo",
+ lineNo, checkRes));
invalid = true;
continue;
}
@@ -442,10 +446,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
resetTabStops();
}
if (!silent && errors.length() != 0) {
- Gui.showMessageBox("Fehler beim Auswerten der angegebenen Netzwerkregeln.\n\n" + errors.toString()
- + "\nBitte geben Sie die Regeln zeilenweise im Format\n"
- + "<host> <port> <IN|OUT>\n"
- + "an.",
+ Gui.showMessageBox(I18n.CONFIGURATOR.getString("NetRules.Message.error.evaluatingNetRules", errors.toString()),
MessageType.ERROR, null, null);
}
if (invalid) {
@@ -486,7 +487,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
*/
private String checkHostnameSimple(String hostname) {
if (hostname.length() > 254) {
- return "Hostname ist zu lang.";
+ return I18n.CONFIGURATOR.getString("NetRules.Message.error.hostnameTooLong");
}
boolean allNumeric = true;
int netmask = -1;
@@ -495,7 +496,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
if (ls != -1) {
netmask = Util.parseInt(hostname.substring(ls + 1), -1);
if (netmask == -1) {
- return "Ungültige Netzmaske.";
+ return I18n.CONFIGURATOR.getString("NetRules.Message.error.invalidNetmask");
}
hostname = hostname.substring(0, ls);
}
@@ -509,18 +510,18 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
// v6
if ((hostname.startsWith(":") && !hostname.startsWith("::"))
|| (hostname.endsWith(":") && ! hostname.endsWith("::"))) {
- return "IPv6-Adresse darf nicht mit einem Doppelpunkt beginnen oder enden.";
+ return I18n.CONFIGURATOR.getString("NetRules.Message.error.IPv6BeginOrEndWithColon");
}
int numCompressed = (hostname.length() - hostname.replace("::", "").length()) / 2;
if (numCompressed > 1) {
- return "IPv6-Adresse darf nicht mehr als einen komprimierten Teil enthalten.";
+ return I18n.CONFIGURATOR.getString("NetRules.Message.error.IPv6MoreThanOneCompressedPart");
}
if (netmask > 128) {
- return "IPv6 Netzmaske kann nicht größer 128 Bit sein.";
+ return I18n.CONFIGURATOR.getString("NetRules.Message.error.IPv6GreaterThan128Bits");
}
domainLabels = hostname.split(":");
if (domainLabels.length > 8) {
- return "IPv6-Adresse enthält zu viele Hextets."; // Yes it's called that apparently
+ return I18n.CONFIGURATOR.getString("NetRules.Message.error.IPv6TooManyHextets"); // Yes it's called that apparently
}
for (String domainLabel : domainLabels) {
if (domainLabel.isEmpty())
@@ -528,26 +529,27 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
try {
int test = Integer.parseInt(domainLabel, 16);
if (test < 0 || test > 65535) {
- return "IPv6-Adresse enthält ungültiges Hextet.";
+ return I18n.CONFIGURATOR.getString("NetRules.Message.error.IPv6InvalidHextet");
}
} catch (Exception e) {
- return "IPv6-Adresse enthält nicht-hexadezimale Zeichen.";
+ return I18n.CONFIGURATOR.getString("NetRules.Message.error.IPv6NonHexadecimalCharacters");
}
}
if (!allNumeric
|| ((domainLabels.length == 8 || numCompressed > 0) && (netmask < -1 || netmask > 128))
|| (domainLabels.length < 8 && numCompressed == 0 && (netmask < 0 || netmask > 128))) {
- return "Fehlerhafte IPv6-Adresse/Netzmaske.";
+ return I18n.CONFIGURATOR.getString("NetRules.Message.error.incorrectIPv6AddressOrNetmask");
}
} else {
// v4 or hostname
if (netmask > 32) {
- return "IPv4 Netzmaske kann nicht größer 32 Bit sein.";
+ return I18n.CONFIGURATOR.getString("NetRules.Message.error.IPv4GreaterThan32Bits");
}
for (String domainLabel : domainLabels) {
if (domainLabel.length() > 63) {
// fail since domain level should be max 63 chars
- return "Domain-Ebene '" + domainLabel + "' länger als 63 Zeichen.";
+ return I18n.CONFIGURATOR.getString("NetRules.Message.error.domainLabelLongerThan63Characters",
+ domainLabel);
}
int i = Util.parseInt(domainLabel, -1);
if (i < 0 || i > 255) {
@@ -559,7 +561,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
if ((domainLabels.length == 4 && (netmask < -1 || netmask > 32))
|| domainLabels.length > 4
|| (domainLabels.length < 4 && (netmask < 0 || netmask > 32))) {
- return "Fehlerhafte IPv4-Adresse/Netzmaske.";
+ return I18n.CONFIGURATOR.getString("NetRules.Message.error.incorrectIPv4AddressOrNetmask");
}
}
}
@@ -574,13 +576,6 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements
class NetrulesConfiguratorLayout extends JPanel {
private static final long serialVersionUID = 5266120380443817325L;
- private final static String STR_RULES_DESCRIPTION = "Wenn Sie den Internetzugriff deaktiviert haben,"
- + " können Sie hier Ausnahmen definieren (Whitelist)."
- + " Bitte definieren Sie Ihre Regeln im Format\n<host> <port> <in|out>.\n"
- + "Sie können Port 0 angeben, was sämtlichen TCP und UDP Ports eines Hosts entspricht.";
- private final static String STR_RULES_ADD = "Wenn Sie Internetzugriff aktivieren,"
- + " hat diese Liste den gegenteiligen Effekt (Blacklist).";
- private final static String STR_TITLE = "Netzwerkregeln";
protected final JTextPane tpNetworkRules;
protected final JButton btnCheckRules;
@@ -592,19 +587,19 @@ class NetrulesConfiguratorLayout extends JPanel {
new Insets(5, 5, 5, 5));
// middle panel for network rules
- this.setBorder(BorderFactory.createTitledBorder(STR_TITLE));
+ this.setBorder(BorderFactory.createTitledBorder(I18n.CONFIGURATOR.getString("NetRules.TitledBorder.title")));
tpNetworkRules = new JTextPane();
resetTabStops();
grid
- .add(new WordWrapLabel(STR_RULES_DESCRIPTION), 2)
+ .add(new WordWrapLabel(I18n.CONFIGURATOR.getString("NetRules.Label.description.text")), 2)
.fill(true, false).expand(true, false);
grid.nextRow();
grid
- .add(new WordWrapLabel(STR_RULES_ADD))
+ .add(new WordWrapLabel(I18n.CONFIGURATOR.getString("NetRules.Label.add.text")))
.fill(true, false).expand(true, false);
- btnCheckRules = new JButton("Regeln überprüfen");
+ btnCheckRules = new JButton(I18n.CONFIGURATOR.getString("NetRules.Button.checkRules.text"));
grid.add(btnCheckRules);
grid.nextRow();
@@ -614,7 +609,7 @@ class NetrulesConfiguratorLayout extends JPanel {
.fill(true, true).expand(true, true);
grid.nextRow();
- btnShowPresets = new JButton("Vordefinierte Regelsets...");
+ btnShowPresets = new JButton(I18n.CONFIGURATOR.getString("NetRules.Button.showPresets.text"));
grid.add(btnShowPresets, 2).anchor(GridBagConstraints.LINE_END);
grid.nextRow();
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java
index 77f2e381..95c45282 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java
@@ -38,6 +38,7 @@ import org.openslx.dozmod.gui.control.table.CheckListTable.Wrapper;
import org.openslx.dozmod.gui.control.table.NetshareTable;
import org.openslx.dozmod.gui.control.table.QScrollPane;
import org.openslx.dozmod.gui.helper.GridManager;
+import org.openslx.dozmod.gui.helper.I18n;
import org.openslx.dozmod.gui.helper.MessageType;
import org.openslx.dozmod.thrift.cache.MetaDataCache;
import org.openslx.dozmod.util.FormatHelper;
@@ -79,7 +80,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
chkIsPrinter.setEnabled(editable);
chkShowPass.setEnabled(editable);
if (editable)
- btnAdd.setText("Ändern");
+ btnAdd.setText(I18n.CONFIGURATOR.getString("NetShare.Button.add.text.0"));
// clear the contents of the fields and return, if no share was selected.
if (item == null) {
@@ -145,7 +146,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
input.path = tfSharePath.getText();
if (input.path == null || input.path.isEmpty()) {
- lblError.setText("Kein Pfad angegeben!");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.noPath"));
return;
}
String inputShareName = tfShareName.getText();
@@ -156,7 +157,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
NetShareAuth inputNetShareAuth = cboNetshareAuth
.getItemAt(cboNetshareAuth.getSelectedIndex());
if (inputNetShareAuth == null) {
- lblError.setText("Kein Authentifizierungstyp angegeben!");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.noAuth"));
return;
}
input.auth = inputNetShareAuth;
@@ -170,7 +171,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
input.username = tfUsername.getText();
input.password = new String(tfPassword.getPassword());
if (input.username.isEmpty()) {
- lblError.setText("Kein Nutzername angegeben!");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.noUsername"));
return;
}
break;
@@ -179,7 +180,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
break;
}
if (input == null) {
- lblError.setText("Fehlerhafte Eingabe");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.incorrectInput"));
LOGGER.debug("Bad input, aborting.");
return;
}
@@ -189,7 +190,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
.getItemAt(cboNetshareMountPoint.getSelectedIndex());
if (!chkIsPrinter.isSelected()) {
if (inputMountPoint == null) {
- lblError.setText("Kein Laufwerk angegeben!");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.noMountPoint"));
return;
}
input.mountpoint = String.valueOf(inputMountPoint);
@@ -201,10 +202,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
// which we might want to implement one day...
if (input.password != null && !input.password.isEmpty()) {
if (!Gui.showMessageBox(
- "Das eingebene Passwort wird im Klartext gespeichert "
- + "und ist in der VM für jeden Nutzer sichtbar.\n"
- + "Verwenden Sie auf keinen Fall sicherheitskritische Passwörter!"
- + "\n\nMöchten Sie diesen Netzlaufwerk trotzdem hinzufügen?",
+ I18n.CONFIGURATOR.getString("NetShare.Message.yesNo.password"),
MessageType.QUESTION_YESNO, LOGGER, null)) {
return;
}
@@ -218,7 +216,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
if (oldEntry != null && oldList.contains(oldEntry)) {
// editing existing one, delete it from the internal data
if (!oldList.remove(oldEntry)) {
- lblError.setText("Änderung fehlgeschlagen!");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.changeFailed"));
LOGGER.error("Failed to remove selected share for replacement: " + oldEntry);
return;
}
@@ -228,7 +226,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
// creating a new one, either way add it to the list and update
// the table, if its not present already
if (oldList.contains(newEntry)) {
- lblError.setText("Existiert bereits!");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.alreadyExists"));
LOGGER.error("Network share already in the list, aborting.");
return;
}
@@ -287,7 +285,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
cboNetshareMountPoint.setSelectedItem(null);
chkIsPrinter.setSelected(false);
chkShowPass.setSelected(false);
- btnAdd.setText("Hinzufügen");
+ btnAdd.setText(I18n.CONFIGURATOR.getString("NetShare.Button.add.text.1"));
}
public List<NetShare> getState() {
@@ -335,10 +333,6 @@ class NetshareConfiguratorLayout extends JPanel {
private static final long serialVersionUID = 6479525981542743622L;
- private final static String txtNetshareDesc = "<html>Hier können Sie Netzlaufwerke angeben,"
- + " die automatisch beim Start der Veranstaltung eingebunden werden sollen."
- + " Der Platzhalter <em>%loginuser%</em> wird im Pfad durch den Loginnamen des Nutzers ersetzt.</html>";
-
protected final JLabel lblError;
protected final NetshareTable tblNetshare = new NetshareTable();
protected final JTextField tfSharePath, tfShareName, tfUsername;
@@ -369,7 +363,8 @@ class NetshareConfiguratorLayout extends JPanel {
public NetshareConfiguratorLayout() {
GridManager grid = new GridManager(this, 3, true, new Insets(3, 3, 3, 3));
// top info panel
- grid.add(new JLabel(txtNetshareDesc), 3).fill(true, false).expand(true, false);
+ grid.add(new JLabel(I18n.CONFIGURATOR.getString("NetShare.Label.description.text")), 3)
+ .fill(true, false).expand(true, false);
grid.nextRow();
// middle netshare list
grid.add(new QScrollPane(tblNetshare), 3).fill(true, true).expand(true, true);
@@ -377,17 +372,18 @@ class NetshareConfiguratorLayout extends JPanel {
JPanel pnlNewShare = new JPanel();
GridManager gridNewShare = new GridManager(pnlNewShare, 6, true, new Insets(0, 3, 0, 3));
- pnlNewShare.setBorder(BorderFactory.createTitledBorder("Eigenes Netzlaufwerk definieren"));
+ pnlNewShare.setBorder(BorderFactory.createTitledBorder(
+ I18n.CONFIGURATOR.getString("NetShare.TitledBorder.newShare.title")));
JPanel pnlSharePath = new JPanel();
pnlSharePath.setLayout(new BoxLayout(pnlSharePath, BoxLayout.LINE_AXIS));
- gridNewShare.add(new QLabel("Pfad"));
+ gridNewShare.add(new QLabel(I18n.CONFIGURATOR.getString("NetShare.Label.sharePath.text")));
tfSharePath = new JTextField();
pnlSharePath.add(tfSharePath);
pnlSharePath.add(Box.createGlue());
pnlSharePath.add(Box.createHorizontalStrut(5));
- chkIsPrinter = new JCheckBox("Drucker");
+ chkIsPrinter = new JCheckBox(I18n.CONFIGURATOR.getString("NetShare.CheckBox.isPrinter.text"));
pnlSharePath.add(chkIsPrinter);
pnlSharePath.add(Box.createHorizontalStrut(5));
gridNewShare.add(pnlSharePath, 5).fill(true, false).expand(true, false);
@@ -399,30 +395,30 @@ class NetshareConfiguratorLayout extends JPanel {
pnlShareName.setLayout(new BoxLayout(pnlShareName, BoxLayout.LINE_AXIS));
pnlShareName.add(tfShareName);
pnlShareName.add(Box.createHorizontalStrut(3));
- pnlShareName.add(new QLabel("Laufwerk"));
+ pnlShareName.add(new QLabel(I18n.CONFIGURATOR.getString("NetShare.Label.shareMountPoint.text")));
pnlShareName.add(Box.createHorizontalStrut(3));
pnlShareName.add(cboNetshareMountPoint);
- gridNewShare.add(new QLabel("Anzeigename"));
+ gridNewShare.add(new QLabel(I18n.CONFIGURATOR.getString("NetShare.Label.shareName.text")));
gridNewShare.add(pnlShareName, 5).fill(true, false).expand(true, false);
gridNewShare.nextRow();
- gridNewShare.add(new QLabel("Authentifizierung"));
+ gridNewShare.add(new QLabel(I18n.CONFIGURATOR.getString("NetShare.Label.shareAuth.text")));
gridNewShare.add(cboNetshareAuth, 5).fill(true, false).expand(true, false);
gridNewShare.nextRow();
- gridNewShare.add(new QLabel("Benutzername"));
+ gridNewShare.add(new QLabel(I18n.CONFIGURATOR.getString("NetShare.Label.username.text")));
tfUsername = new JTextField(20);
gridNewShare.add(tfUsername, 2).fill(true, false).expand(true, false);
- gridNewShare.add(new QLabel("Passwort"));
+ gridNewShare.add(new QLabel(I18n.CONFIGURATOR.getString("NetShare.Label.password.text")));
tfPassword = new JPasswordField(20);
gridNewShare.add(tfPassword, 2).fill(true, false).expand(true, false);
gridNewShare.nextRow();
- chkShowPass = new JCheckBox("Passwort anzeigen");
+ chkShowPass = new JCheckBox(I18n.CONFIGURATOR.getString("NetShare.CheckBox.showPassword.text"));
gridNewShare.add(Box.createGlue(), 5);
gridNewShare.add(chkShowPass).anchor(GridBagConstraints.EAST);
gridNewShare.nextRow();
grid.add(pnlNewShare, 3).fill(true, false).expand(true, false);
grid.nextRow();
- btnAdd = new JButton("Hinzufügen");
- btnDel = new JButton("Entfernen");
+ btnAdd = new JButton(I18n.CONFIGURATOR.getString("NetShare.Button.add.text.1"));
+ btnDel = new JButton(I18n.CONFIGURATOR.getString("NetShare.Button.delete.text"));
lblError = new QLabel("");
lblError.setForeground(Color.RED);
grid.add(lblError).fill(true, false).expand(true, false);
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/StartupConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/StartupConfigurator.java
index 16267690..eadc7339 100755
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/StartupConfigurator.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/StartupConfigurator.java
@@ -41,6 +41,7 @@ import org.openslx.dozmod.gui.control.ComboBox.ComboBoxRenderer;
import org.openslx.dozmod.gui.control.QLabel;
import org.openslx.dozmod.gui.control.WordWrapLabel;
import org.openslx.dozmod.gui.helper.GridManager;
+import org.openslx.dozmod.gui.helper.I18n;
import org.openslx.dozmod.gui.helper.MessageType;
import org.openslx.dozmod.thrift.Session;
import org.openslx.dozmod.thrift.cache.MetaDataCache;
@@ -96,11 +97,12 @@ public class StartupConfigurator extends StartupConfiguratorLayout {
private void showRunscriptSelector() {
if (scripts == null) {
- Gui.showMessageBox("Wah wah wah! Null scripts", MessageType.ERROR, null, null);
+ Gui.showMessageBox(I18n.CONFIGURATOR.getString("Startup.Message.error.noScripts"),
+ MessageType.ERROR, null, null);
return;
}
final JDialog dialog = new JDialog(SwingUtilities.getWindowAncestor(this),
- "Auswahl", ModalityType.APPLICATION_MODAL);
+ I18n.CONFIGURATOR.getString("Startup.Dialog.title"), ModalityType.APPLICATION_MODAL);
JPanel pane = new JPanel();
pane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "cancel");
@@ -116,7 +118,8 @@ public class StartupConfigurator extends StartupConfiguratorLayout {
dialog.setMinimumSize(dd);
dialog.setPreferredSize(dd);
GridManager grid = new GridManager(pane, 3, true, new Insets(2, 2, 2, 2));
- grid.add(new WordWrapLabel("Vordefinierte Startskripte:"), 3).fill(true, false);
+ grid.add(new WordWrapLabel(I18n.CONFIGURATOR.getString("Startup.Label.predefinedScripts.text")), 3)
+ .fill(true, false);
grid.nextRow();
final Map<ButtonModel, Integer> mapper = new HashMap<>();
boolean haveDisabled = false;
@@ -135,15 +138,14 @@ public class StartupConfigurator extends StartupConfiguratorLayout {
}
}
if (haveDisabled) {
- grid.add(new WordWrapLabel("Ausgegraute Elemente sind mit dem zur"
- + " Veranstaltung gehörendem Betriebssystem nicht kompatibel."), 3)
+ grid.add(new WordWrapLabel(I18n.CONFIGURATOR.getString("Startup.Label.greyedOutElements.text")), 3)
.fill(true, false);
grid.nextRow();
}
grid.add(Box.createVerticalGlue(), 3).expand(true, true).fill(true, true);
grid.nextRow();
- JButton btnCancel = new JButton("Abbrechen");
- JButton btnOk = new JButton("Speichern");
+ JButton btnCancel = new JButton(I18n.CONFIGURATOR.getString("Startup.Button.cancel.text"));
+ JButton btnOk = new JButton(I18n.CONFIGURATOR.getString("Startup.Button.ok.text"));
grid.add(Box.createHorizontalGlue()).expand(true, true).fill(true, true);
grid.add(btnCancel);
grid.add(btnOk);
@@ -386,8 +388,6 @@ class StartupConfiguratorLayout extends JPanel {
private static final long serialVersionUID = 648729071828404053L;
- private final static String RUN_SCRIPT_HELP = "Ein hier eingetragenes Skript wird nach dem Start"
- + " der VM automatisch ausgeführt.";
protected final QLabel lblError;
protected final JTextArea taRunScript;
protected final ComboBox<RunscriptType> cboRunscriptType;
@@ -397,7 +397,7 @@ class StartupConfiguratorLayout extends JPanel {
public StartupConfiguratorLayout() {
GridManager grid = new GridManager(this, 2, true, new Insets(5, 5, 5, 5));
- grid.add(new QLabel("Audio"));
+ grid.add(new QLabel(I18n.CONFIGURATOR.getString("Startup.Label.audio.text")));
cboSoundState = new ComboBox<>(new ComboBoxRenderer<SoundState>() {
@Override
public String renderItem(SoundState item) {
@@ -411,7 +411,7 @@ class StartupConfiguratorLayout extends JPanel {
grid.add(Box.createVerticalStrut(4), 2);
grid.nextRow();
- grid.add(new WordWrapLabel(RUN_SCRIPT_HELP, false, true), 2)
+ grid.add(new WordWrapLabel(I18n.CONFIGURATOR.getString("Startup.Label.description.text"), false, true), 2)
.fill(true, false).expand(true, false);
grid.nextRow();
@@ -427,7 +427,7 @@ class StartupConfiguratorLayout extends JPanel {
cboRunscriptType.setModel(new DefaultComboBoxModel<RunscriptType>(
RunscriptType.values()));
cboRunscriptType.setEditable(true);
- grid.add(new QLabel("Dateinamenserweiterung: ")).fill(false, false)
+ grid.add(new QLabel(I18n.CONFIGURATOR.getString("Startup.Label.scriptType.text"))).fill(false, false)
.expand(false, false);
grid.add(cboRunscriptType).fill(true, false)
.expand(true, false);
@@ -442,7 +442,7 @@ class StartupConfiguratorLayout extends JPanel {
}
});
cboRunscriptVisibility.setModel(new DefaultComboBoxModel<RunscriptVisibility>(RunscriptVisibility.values()));
- grid.add(new QLabel("Sichtbarkeit: ")).fill(false, false)
+ grid.add(new QLabel(I18n.CONFIGURATOR.getString("Startup.Label.visibility.text"))).fill(false, false)
.expand(false, false);
grid.add(cboRunscriptVisibility).fill(true, false)
.expand(true, false);
@@ -457,7 +457,7 @@ class StartupConfiguratorLayout extends JPanel {
grid.add(scpRunScript, 2).fill(true, true).expand(true, true);
grid.nextRow();
- btnPredefinedScripts = new JButton("Vordefinierte Skripte...");
+ btnPredefinedScripts = new JButton(I18n.CONFIGURATOR.getString("Startup.Button.predefinedScripts.text"));
grid.add(btnPredefinedScripts, 2).anchor(GridBagConstraints.LINE_END);
grid.nextRow();
@@ -475,7 +475,8 @@ class StartupConfiguratorLayout extends JPanel {
enum RunscriptType {
- SHELL("Shellskript", "sh"), BATCH("Windows-Batch", "bat");
+ SHELL(I18n.CONFIGURATOR.getString("Startup.ScriptType.shell"), "sh"),
+ BATCH(I18n.CONFIGURATOR.getString("Startup.ScriptType.batch"), "bat");
public final String displayName;
public final String extension;
@@ -492,7 +493,9 @@ enum RunscriptType {
}
enum RunscriptVisibility {
- NORMAL("Normal", 1), MINIMIZED("Minimiert", 2), HIDDEN("Versteckt", 0);
+ NORMAL(I18n.CONFIGURATOR.getString("Startup.ScriptVisibility.normal"), 1),
+ MINIMIZED(I18n.CONFIGURATOR.getString("Startup.ScriptVisibility.minimized"), 2),
+ HIDDEN(I18n.CONFIGURATOR.getString("Startup.ScriptVisibility.hidden"), 0);
public final String displayName;
public final int value;
@@ -504,7 +507,9 @@ enum RunscriptVisibility {
}
enum SoundState {
- DEFAULT("Vorgabe des Pools", -1), MUTED("Stummschalten", 1), UNMUTED("Aktivieren", 0);
+ DEFAULT(I18n.CONFIGURATOR.getString("Startup.SoundState.default"), -1),
+ MUTED(I18n.CONFIGURATOR.getString("Startup.SoundState.muted"), 1),
+ UNMUTED(I18n.CONFIGURATOR.getString("Startup.SoundState.unmuted"), 0);
public final String displayName;
public final int value;