From 723bcc3e55a703ac496f5bcb0c17e8ba8ec60a7a Mon Sep 17 00:00:00 2001 From: Bixilon Date: Sun, 25 Oct 2020 13:42:42 +0100 Subject: [PATCH] manage account error: translate --- .../java/de/bixilon/minosoft/data/locale/Strings.java | 9 ++++++++- .../java/de/bixilon/minosoft/gui/main/AccountWindow.java | 2 +- .../java/de/bixilon/minosoft/gui/main/MainWindow.java | 8 ++++---- src/main/resources/assets/locale/de_DE.json | 8 ++++++-- src/main/resources/assets/locale/en_US.json | 8 ++++++-- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/bixilon/minosoft/data/locale/Strings.java b/src/main/java/de/bixilon/minosoft/data/locale/Strings.java index 871053f8c..e250bb5cf 100644 --- a/src/main/java/de/bixilon/minosoft/data/locale/Strings.java +++ b/src/main/java/de/bixilon/minosoft/data/locale/Strings.java @@ -18,6 +18,7 @@ public enum Strings { PASSWORD, OFFLINE, CONNECTING, + ERROR, ADD_SERVER_DIALOG_TITLE, ADD_SERVER_DIALOG_HEADER, @@ -71,9 +72,15 @@ public enum Strings { SETTINGS_GENERAL_LOG_LEVEL, SETTINGS_DOWNLOAD, + MANAGE_ACCOUNTS_TITLE, + MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR_TITLE, + MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR_HEADER, + MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR_ERROR, + MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR, + + LOGIN_DIALOG_TITLE, LOGIN_DIALOG_HEADER, - LOGIN_ERROR, MINOSOFT_STILL_STARTING_TITLE, MINOSOFT_STILL_STARTING_HEADER, diff --git a/src/main/java/de/bixilon/minosoft/gui/main/AccountWindow.java b/src/main/java/de/bixilon/minosoft/gui/main/AccountWindow.java index 56ba0cc9e..56c8330ff 100644 --- a/src/main/java/de/bixilon/minosoft/gui/main/AccountWindow.java +++ b/src/main/java/de/bixilon/minosoft/gui/main/AccountWindow.java @@ -96,7 +96,7 @@ public class AccountWindow implements Initializable { error.setStyle("-fx-text-fill: red"); error.setText(attempt.getError()); - grid.add(new Label(LocaleManager.translate(Strings.LOGIN_ERROR)), 0, 2); + grid.add(new Label(LocaleManager.translate(Strings.ERROR)), 0, 2); grid.add(error, 1, 2); // ToDo resize window }); diff --git a/src/main/java/de/bixilon/minosoft/gui/main/MainWindow.java b/src/main/java/de/bixilon/minosoft/gui/main/MainWindow.java index 1f0021f90..fb5834ac4 100644 --- a/src/main/java/de/bixilon/minosoft/gui/main/MainWindow.java +++ b/src/main/java/de/bixilon/minosoft/gui/main/MainWindow.java @@ -58,15 +58,15 @@ public class MainWindow implements Initializable { Parent parent = new FXMLLoader(MainWindow.class.getResource("/layout/accounts.fxml")).load(); Stage stage = new Stage(); stage.initModality(Modality.APPLICATION_MODAL); - stage.setTitle("Manage accounts - Minosoft"); + stage.setTitle(LocaleManager.translate(Strings.MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR_TITLE)); stage.setScene(new Scene(parent)); Platform.setImplicitExit(false); stage.setOnCloseRequest(event -> { if (Minosoft.getSelectedAccount() == null) { event.consume(); - Alert alert = new Alert(Alert.AlertType.WARNING, "Error", ButtonType.CANCEL, ButtonType.OK); - alert.setHeaderText("Are you sure?"); - alert.setContentText("No account selected, Minosoft will exit."); + Alert alert = new Alert(Alert.AlertType.WARNING, LocaleManager.translate(Strings.ERROR), ButtonType.CANCEL, ButtonType.OK); + alert.setHeaderText(LocaleManager.translate(Strings.MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR_HEADER)); + alert.setContentText(LocaleManager.translate(Strings.MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR_ERROR)); alert.showAndWait().ifPresent((type) -> { if (type == ButtonType.OK) { System.exit(0); diff --git a/src/main/resources/assets/locale/de_DE.json b/src/main/resources/assets/locale/de_DE.json index d40448553..3dad16757 100644 --- a/src/main/resources/assets/locale/de_DE.json +++ b/src/main/resources/assets/locale/de_DE.json @@ -56,7 +56,11 @@ "SETTINGS_DOWNLOAD": "Download", "LOGIN_DIALOG_TITLE": "Anmelden - Minosoft", "LOGIN_DIALOG_HEADER": "Bitte gib deine Zugangsdaten ein um fortzufahren", - "LOGIN_ERROR": "Fehler", + "ERROR": "Fehler", "MINOSOFT_STILL_STARTING_TITLE": "Bitte warten", - "MINOSOFT_STILL_STARTING_HEADER": "Minosoft braucht noch um zu starten..." + "MINOSOFT_STILL_STARTING_HEADER": "Minosoft braucht noch um zu starten...", + "MANAGE_ACCOUNTS_TITLE": "Nutzer verwalten", + "MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR_TITLE": "Nutzer verwalten", + "MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR_HEADER": "Bist du sicher?", + "MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR_ERROR": "Du hast noch keinen Account ausgewählt. Minosoft wird beendet." } \ No newline at end of file diff --git a/src/main/resources/assets/locale/en_US.json b/src/main/resources/assets/locale/en_US.json index e43322e9c..c208e051a 100644 --- a/src/main/resources/assets/locale/en_US.json +++ b/src/main/resources/assets/locale/en_US.json @@ -56,7 +56,11 @@ "SETTINGS_DOWNLOAD": "Download", "LOGIN_DIALOG_TITLE": "Login - Minosoft", "LOGIN_DIALOG_HEADER": "Please login to your mojang account", - "LOGIN_ERROR": "Error", + "ERROR": "Error", "MINOSOFT_STILL_STARTING_TITLE": "Please wait", - "MINOSOFT_STILL_STARTING_HEADER": "Minosoft is still starting up..." + "MINOSOFT_STILL_STARTING_HEADER": "Minosoft is still starting up...", + "MANAGE_ACCOUNTS_TITLE": "Manage accounts", + "MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR_TITLE": "Manage accounts", + "MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR_HEADER": "Are you sure?", + "MANAGE_ACCOUNTS_NO_ACCOUNT_ERROR_ERROR": "No account selected, Minosoft will exit." } \ No newline at end of file