Localizable file picker title

This commit is contained in:
Sebastian Stenzel
2019-07-25 12:41:02 +02:00
parent 87c654b43d
commit 4138747fc3
3 changed files with 7 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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

View File

@@ -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