Browse Source

Localizable file picker title

Sebastian Stenzel 6 years ago
parent
commit
4138747fc3

+ 5 - 3
main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/ChooseExistingVaultController.java

@@ -14,6 +14,7 @@ import org.cryptomator.ui.model.VaultFactory;
 import javax.inject.Inject;
 import java.io.File;
 import java.nio.file.Path;
+import java.util.ResourceBundle;
 
 @AddVaultWizardScoped
 public class ChooseExistingVaultController implements FxController {
@@ -23,21 +24,22 @@ public class ChooseExistingVaultController implements FxController {
 	private final ObjectProperty<Path> vaultPath;
 	private final ObservableList<Vault> vaults;
 	private final VaultFactory vaultFactory;
+	private final ResourceBundle resourceBundle;
 
 	@Inject
-	ChooseExistingVaultController(@AddVaultWizard Stage window, @AddVaultWizard FXMLLoaderFactory fxmlLoaders, ObjectProperty<Path> vaultPath, ObservableList<Vault> vaults, VaultFactory vaultFactory) {
+	ChooseExistingVaultController(@AddVaultWizard Stage window, @AddVaultWizard FXMLLoaderFactory fxmlLoaders, ObjectProperty<Path> vaultPath, ObservableList<Vault> vaults, VaultFactory vaultFactory, ResourceBundle resourceBundle) {
 		this.window = window;
 		this.fxmlLoaders = fxmlLoaders;
 		this.vaultPath = vaultPath;
 		this.vaults = vaults;
 		this.vaultFactory = vaultFactory;
+		this.resourceBundle = resourceBundle;
 	}
 
 	@FXML
 	public void chooseFile() {
 		FileChooser fileChooser = new FileChooser();
-		//TODO: Title is part of the localization. => inject resource bundle and get correct title
-		fileChooser.setTitle("TODO Open Masterkey File");
+		fileChooser.setTitle(resourceBundle.getString("addvaultwizard.existing.filePickerTitle"));
 		fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("Cryptomator Masterkey", "*.cryptomator"));
 		final File file = fileChooser.showOpenDialog(window);
 		if (file != null) {

+ 1 - 0
main/ui/src/main/resources/i18n/strings.properties

@@ -1,4 +1,5 @@
 addvaultwizard.existing.instruction=Please choose the masterkey.cryptomator file of your existing vault 
+addvaultwizard.existing.filePickerTitle=Open Masterkey File
 main.closeBtn.tooltip=Close
 main.settingsBtn.tooltip=Settings
 preferences.autoUpdateCheck=Check for updates automatically

+ 1 - 0
main/ui/src/main/resources/i18n/strings_en.properties

@@ -1,4 +1,5 @@
 addvaultwizard.existing.instruction=Please choose the masterkey.cryptomator file of your existing vault 
+addvaultwizard.existing.filePickerTitle=Open Masterkey File
 main.closeBtn.tooltip=Close
 main.settingsBtn.tooltip=Settings
 preferences.autoUpdateCheck=Check for updates automatically