From dffd4d9dd9ef66bcb5cd874a57bbe9d460ed3516 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 29 Jun 2022 10:07:03 +0200 Subject: [PATCH] change translation keys to use unified dialog scheme --- .../ui/health/HealthCheckModule.java | 2 +- .../org/cryptomator/ui/quit/QuitModule.java | 2 +- .../RecoveryKeyCreationController.java | 4 +- .../ui/recoverykey/RecoveryKeyModule.java | 3 +- .../RecoveryKeyRecoverController.java | 4 +- .../ui/removevault/RemoveVaultModule.java | 2 +- .../wrongfilealert/WrongFileAlertModule.java | 2 +- src/main/resources/fxml/error.fxml | 10 ++-- src/main/resources/fxml/lock_failed.fxml | 2 +- src/main/resources/fxml/lock_forced.fxml | 3 +- src/main/resources/fxml/quit.fxml | 6 +-- .../resources/fxml/recoverykey_create.fxml | 4 +- src/main/resources/fxml/remove_vault.fxml | 3 +- .../fxml/unlock_invalid_mount_point.fxml | 2 +- .../fxml/unlock_select_masterkeyfile.fxml | 5 +- src/main/resources/fxml/unlock_success.fxml | 4 +- src/main/resources/fxml/wrongfilealert.fxml | 3 +- src/main/resources/i18n/strings.properties | 54 ++++++++++--------- 18 files changed, 59 insertions(+), 56 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/health/HealthCheckModule.java b/src/main/java/org/cryptomator/ui/health/HealthCheckModule.java index cb8dc2ff1..c36f486e0 100644 --- a/src/main/java/org/cryptomator/ui/health/HealthCheckModule.java +++ b/src/main/java/org/cryptomator/ui/health/HealthCheckModule.java @@ -81,7 +81,7 @@ abstract class HealthCheckModule { Stage stage = factory.create(); stage.initModality(Modality.WINDOW_MODAL); stage.initOwner(window); - stage.setTitle(String.format(resourceBundle.getString("unlock.windowTitle"), vault.getDisplayName())); + stage.setTitle(String.format(resourceBundle.getString("unlock.title"), vault.getDisplayName())); stage.setResizable(false); return stage; } diff --git a/src/main/java/org/cryptomator/ui/quit/QuitModule.java b/src/main/java/org/cryptomator/ui/quit/QuitModule.java index 55398aa76..a1dc581ed 100644 --- a/src/main/java/org/cryptomator/ui/quit/QuitModule.java +++ b/src/main/java/org/cryptomator/ui/quit/QuitModule.java @@ -34,7 +34,7 @@ abstract class QuitModule { @QuitScoped static Stage provideStage(StageFactory factory, ResourceBundle resourceBundle) { Stage stage = factory.create(); - stage.setTitle(resourceBundle.getString("quit.windowTitle")); + stage.setTitle(resourceBundle.getString("quit.title")); stage.setMinWidth(300); stage.setMinHeight(100); stage.initModality(Modality.APPLICATION_MODAL); diff --git a/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java b/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java index 87dcbd0e8..77f191015 100644 --- a/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java +++ b/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java @@ -20,6 +20,7 @@ import javafx.fxml.FXML; import javafx.scene.Scene; import javafx.stage.Stage; import java.io.IOException; +import java.util.ResourceBundle; import java.util.concurrent.ExecutorService; @RecoveryKeyScoped @@ -37,8 +38,9 @@ public class RecoveryKeyCreationController implements FxController { public NiceSecurePasswordField passwordField; @Inject - public RecoveryKeyCreationController(@RecoveryKeyWindow Stage window, @FxmlScene(FxmlFile.RECOVERYKEY_SUCCESS) Lazy successScene, @RecoveryKeyWindow Vault vault, RecoveryKeyFactory recoveryKeyFactory, ExecutorService executor, @RecoveryKeyWindow StringProperty recoveryKey, FxApplicationWindows appWindows) { + public RecoveryKeyCreationController(@RecoveryKeyWindow Stage window, @FxmlScene(FxmlFile.RECOVERYKEY_SUCCESS) Lazy successScene, @RecoveryKeyWindow Vault vault, RecoveryKeyFactory recoveryKeyFactory, ExecutorService executor, @RecoveryKeyWindow StringProperty recoveryKey, FxApplicationWindows appWindows, ResourceBundle resourceBundle) { this.window = window; + window.setTitle(resourceBundle.getString("recoveryKey.display.title")); this.successScene = successScene; this.vault = vault; this.executor = executor; diff --git a/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyModule.java b/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyModule.java index 0522e3a8d..7e730a245 100644 --- a/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyModule.java +++ b/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyModule.java @@ -53,9 +53,8 @@ abstract class RecoveryKeyModule { @Provides @RecoveryKeyWindow @RecoveryKeyScoped - static Stage provideStage(StageFactory factory, ResourceBundle resourceBundle, @Named("keyRecoveryOwner") Stage owner) { + static Stage provideStage(StageFactory factory, @Named("keyRecoveryOwner") Stage owner) { Stage stage = factory.create(); - stage.setTitle(resourceBundle.getString("recoveryKey.title")); stage.setResizable(false); stage.initModality(Modality.WINDOW_MODAL); stage.initOwner(owner); diff --git a/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyRecoverController.java b/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyRecoverController.java index e05a73169..61cdebcd9 100644 --- a/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyRecoverController.java +++ b/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyRecoverController.java @@ -26,6 +26,7 @@ import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.stage.Stage; import java.util.Optional; +import java.util.ResourceBundle; @RecoveryKeyScoped public class RecoveryKeyRecoverController implements FxController { @@ -45,8 +46,9 @@ public class RecoveryKeyRecoverController implements FxController { public TextArea textarea; @Inject - public RecoveryKeyRecoverController(@RecoveryKeyWindow Stage window, @RecoveryKeyWindow Vault vault, @RecoveryKeyWindow @Nullable VaultConfig.UnverifiedVaultConfig unverifiedVaultConfig, @RecoveryKeyWindow StringProperty recoveryKey, RecoveryKeyFactory recoveryKeyFactory, @FxmlScene(FxmlFile.RECOVERYKEY_RESET_PASSWORD) Lazy resetPasswordScene) { + public RecoveryKeyRecoverController(@RecoveryKeyWindow Stage window, @RecoveryKeyWindow Vault vault, @RecoveryKeyWindow @Nullable VaultConfig.UnverifiedVaultConfig unverifiedVaultConfig, @RecoveryKeyWindow StringProperty recoveryKey, RecoveryKeyFactory recoveryKeyFactory, @FxmlScene(FxmlFile.RECOVERYKEY_RESET_PASSWORD) Lazy resetPasswordScene, ResourceBundle resourceBundle) { this.window = window; + window.setTitle(resourceBundle.getString("recoveryKey.recover.title")); this.vault = vault; this.unverifiedVaultConfig = unverifiedVaultConfig; this.recoveryKey = recoveryKey; diff --git a/src/main/java/org/cryptomator/ui/removevault/RemoveVaultModule.java b/src/main/java/org/cryptomator/ui/removevault/RemoveVaultModule.java index ee94a7d7a..7a5b71304 100644 --- a/src/main/java/org/cryptomator/ui/removevault/RemoveVaultModule.java +++ b/src/main/java/org/cryptomator/ui/removevault/RemoveVaultModule.java @@ -36,7 +36,7 @@ abstract class RemoveVaultModule { @RemoveVaultScoped static Stage provideStage(StageFactory factory, @PrimaryStage Stage primaryStage, @RemoveVaultWindow Vault v, ResourceBundle resourceBundle) { Stage stage = factory.create(); - stage.setTitle(String.format(resourceBundle.getString("removeVault.windowTitle"),v.getDisplayName())); + stage.setTitle(String.format(resourceBundle.getString("removeVault.title"),v.getDisplayName())); stage.setResizable(false); stage.initModality(Modality.WINDOW_MODAL); stage.initOwner(primaryStage); diff --git a/src/main/java/org/cryptomator/ui/wrongfilealert/WrongFileAlertModule.java b/src/main/java/org/cryptomator/ui/wrongfilealert/WrongFileAlertModule.java index f99356142..19dd486fb 100644 --- a/src/main/java/org/cryptomator/ui/wrongfilealert/WrongFileAlertModule.java +++ b/src/main/java/org/cryptomator/ui/wrongfilealert/WrongFileAlertModule.java @@ -35,7 +35,7 @@ abstract class WrongFileAlertModule { @WrongFileAlertScoped static Stage provideStage(StageFactory factory, @PrimaryStage Stage primaryStage, ResourceBundle resourceBundle) { Stage stage = factory.create(); - stage.setTitle(resourceBundle.getString("wrongFileAlert.windowTitle")); + stage.setTitle(resourceBundle.getString("wrongFileAlert.title")); stage.setResizable(false); stage.initOwner(primaryStage); stage.initModality(Modality.WINDOW_MODAL); diff --git a/src/main/resources/fxml/error.fxml b/src/main/resources/fxml/error.fxml index 418f3dfff..1bb8a5ae2 100644 --- a/src/main/resources/fxml/error.fxml +++ b/src/main/resources/fxml/error.fxml @@ -30,14 +30,14 @@ - -