diff --git a/src/main/java/org/cryptomator/ui/health/Check.java b/src/main/java/org/cryptomator/ui/health/Check.java index d1529a270..58494b9f6 100644 --- a/src/main/java/org/cryptomator/ui/health/Check.java +++ b/src/main/java/org/cryptomator/ui/health/Check.java @@ -11,15 +11,12 @@ import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; -import java.util.MissingResourceException; -import java.util.ResourceBundle; public class Check { private static final String LOCALIZE_PREFIX = "health."; private final HealthCheck check; - private final ResourceBundle resourceBundle; private final BooleanProperty chosenForExecution = new SimpleBooleanProperty(false); private final ObjectProperty state = new SimpleObjectProperty<>(CheckState.RUNNABLE); @@ -28,17 +25,12 @@ public class Check { private final ObjectProperty error = new SimpleObjectProperty<>(null); private final BooleanBinding isInReRunState = state.isNotEqualTo(CheckState.RUNNING).or(state.isNotEqualTo(CheckState.SCHEDULED)); - Check(HealthCheck check, ResourceBundle resourceBundle) { + Check(HealthCheck check) { this.check = check; - this.resourceBundle = resourceBundle; } - String getLocalizedName() { - try { - return resourceBundle.getString(LOCALIZE_PREFIX+check.name()); - } catch (MissingResourceException e){ - return check.name(); - } + String getName() { + return check.name(); } HealthCheck getHealthCheck() { diff --git a/src/main/java/org/cryptomator/ui/health/CheckDetailController.java b/src/main/java/org/cryptomator/ui/health/CheckDetailController.java index aaff0e610..66f2e9bf5 100644 --- a/src/main/java/org/cryptomator/ui/health/CheckDetailController.java +++ b/src/main/java/org/cryptomator/ui/health/CheckDetailController.java @@ -3,7 +3,6 @@ package org.cryptomator.ui.health; import com.tobiasdiez.easybind.EasyBind; import com.tobiasdiez.easybind.EasyObservableList; import com.tobiasdiez.easybind.Subscription; -import com.tobiasdiez.easybind.optional.ObservableOptionalValue; import com.tobiasdiez.easybind.optional.OptionalBinding; import org.cryptomator.cryptofs.health.api.DiagnosticResult; import org.cryptomator.ui.common.FxController; @@ -46,7 +45,7 @@ public class CheckDetailController implements FxController { this.results = EasyBind.wrapList(FXCollections.observableArrayList()); this.check = selectedTask; this.checkState = EasyBind.wrapNullable(selectedTask).mapObservable(Check::stateProperty); - this.checkName = EasyBind.wrapNullable(selectedTask).map(Check::getLocalizedName).orElse(""); + this.checkName = EasyBind.wrapNullable(selectedTask).map(Check::getName).orElse(""); this.checkRunning = checkState.map(Check.CheckState.RUNNING::equals).orElse(false); this.checkScheduled = checkState.map(Check.CheckState.SCHEDULED::equals).orElse(false); this.checkSkipped = checkState.map(Check.CheckState.SKIPPED::equals).orElse(false); diff --git a/src/main/java/org/cryptomator/ui/health/CheckListCellController.java b/src/main/java/org/cryptomator/ui/health/CheckListCellController.java index 320fe3b36..799b73358 100644 --- a/src/main/java/org/cryptomator/ui/health/CheckListCellController.java +++ b/src/main/java/org/cryptomator/ui/health/CheckListCellController.java @@ -27,7 +27,7 @@ public class CheckListCellController implements FxController { public CheckListCellController() { check = new SimpleObjectProperty<>(); checkRunnable = EasyBind.wrapNullable(check).mapObservable(Check::stateProperty).map(Check.CheckState.RUNNABLE::equals).orElse(false); - checkName = EasyBind.wrapNullable(check).map(Check::getLocalizedName).orElse(""); + checkName = EasyBind.wrapNullable(check).map(Check::getName).orElse(""); subscriptions = new ArrayList<>(); } diff --git a/src/main/java/org/cryptomator/ui/health/HealthCheckModule.java b/src/main/java/org/cryptomator/ui/health/HealthCheckModule.java index 80a313dc8..e645adff8 100644 --- a/src/main/java/org/cryptomator/ui/health/HealthCheckModule.java +++ b/src/main/java/org/cryptomator/ui/health/HealthCheckModule.java @@ -67,8 +67,8 @@ abstract class HealthCheckModule { @Provides @HealthCheckScoped - static List provideAvailableChecks(ResourceBundle bundle) { - return HealthCheck.allChecks().stream().map(hc -> new Check(hc, bundle)).toList(); + static List provideAvailableChecks() { + return HealthCheck.allChecks().stream().map(Check::new).toList(); } @Provides diff --git a/src/main/resources/i18n/strings.properties b/src/main/resources/i18n/strings.properties index 23caf5871..19e5b6d79 100644 --- a/src/main/resources/i18n/strings.properties +++ b/src/main/resources/i18n/strings.properties @@ -176,8 +176,6 @@ health.check.detail.checkFailed=The check exited due to an error. health.check.detail.checkCancelled=The check was cancelled. health.check.exportBtn=Export Report health.check.fixBtn=Fix -## Checks -health.org.cryptomator.cryptofs.health.dirid.DirIdCheck=Directory Check # Preferences preferences.title=Preferences