From 5a7a0ba35bfec9cb9c6a764425f070600c212027 Mon Sep 17 00:00:00 2001 From: smb Date: Sat, 5 Sep 2026 09:28:03 +0200 Subject: [PATCH 1/2] fix: translate the execution-provider strings from German to English MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The execution-provider feature introduced four German strings into an otherwise English UI: the accessible name and form-row label for the compute-acceleration picker in the inspector, the invalidation reason recorded when the provider changes, and the "recommended" suffix appended to a provider's label. Everything around them (the other inspector form labels, the CLI's own "[recommended]" marker) is English, so the German stood out as an inconsistency rather than a deliberate choice. Changed "Rechenbeschleunigung" to "Compute acceleration" in src/matteloop/ui/inspector.py (accessible name and form label) and in src/matteloop/core/parameters.py (the stale_category reason recorded by _reduce_execution_provider). Changed the "– empfohlen" suffix built in src/matteloop/core/execution_providers.py to "– recommended", keeping the same en-dash and spacing so provider labels read e.g. "CPU – recommended". Updated the tests that asserted on the old German text so they match the new English strings: the CLI smoke test's --providers output, the inspector test's provider-option fixtures, and the execution-provider unit tests' expected labels. Trigger: repro — running `matteloop --providers`, or opening the inspector's execution-provider row, showed "Rechenbeschleunigung" and "– empfohlen" next to English labels like "Edge treatment" and "Output FPS". Co-Authored-By: Claude Opus 5 (1M context) --- src/matteloop/core/execution_providers.py | 2 +- src/matteloop/core/parameters.py | 2 +- src/matteloop/ui/inspector.py | 4 ++-- tests/core/test_execution_providers.py | 4 ++-- tests/core/test_parameters.py | 2 +- tests/test_app_smoke.py | 5 ++++- tests/ui/test_parameter_inspector.py | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/matteloop/core/execution_providers.py b/src/matteloop/core/execution_providers.py index c04cb88..ca13af8 100644 --- a/src/matteloop/core/execution_providers.py +++ b/src/matteloop/core/execution_providers.py @@ -169,5 +169,5 @@ def _provider_label( if provider == COREML_EXECUTION_PROVIDER and model_id.startswith("birefnet"): return f"{label} – experimentell" if provider == recommended: - return f"{label} – empfohlen" + return f"{label} – recommended" return label diff --git a/src/matteloop/core/parameters.py b/src/matteloop/core/parameters.py index e8d1134..c227f6c 100644 --- a/src/matteloop/core/parameters.py +++ b/src/matteloop/core/parameters.py @@ -235,7 +235,7 @@ def _reduce_execution_provider( return _invalidate( state, replace(state.parameters, execution_provider=event.execution_provider), - "Rechenbeschleunigung", + "Compute acceleration", ) diff --git a/src/matteloop/ui/inspector.py b/src/matteloop/ui/inspector.py index 1739393..4dcc65f 100644 --- a/src/matteloop/ui/inspector.py +++ b/src/matteloop/ui/inspector.py @@ -205,7 +205,7 @@ def _build_segmentation_parameter_controls(self) -> None: self.set_model_status("ready") self.provider_picker = compact_field(ElidingComboBox()) self.provider_picker.setObjectName("provider_picker") - self.provider_picker.setAccessibleName("Rechenbeschleunigung") + self.provider_picker.setAccessibleName("Compute acceleration") self._set_provider_options(catalog.default_id) self.edge_picker = compact_field(ElidingComboBox()) self.edge_picker.setObjectName("edge_picker") @@ -636,7 +636,7 @@ def _segmentation_controls(self) -> QWidget: model_layout.addWidget(self.model_picker, 1) model_layout.addWidget(self.model_status) layout.addRow(self._form_label("Model"), model_row) - layout.addRow(self._form_label("Rechenbeschleunigung"), self.provider_picker) + layout.addRow(self._form_label("Compute acceleration"), self.provider_picker) layout.addRow(self._form_label("Edge treatment"), self.edge_picker) return controls diff --git a/tests/core/test_execution_providers.py b/tests/core/test_execution_providers.py index 598a7e1..82301be 100644 --- a/tests/core/test_execution_providers.py +++ b/tests/core/test_execution_providers.py @@ -51,7 +51,7 @@ def test_apple_silicon_prefers_cpu_while_offering_coreml_as_experimental() -> No COREML_EXECUTION_PROVIDER, ] assert select_provider(None, options) == CPU_EXECUTION_PROVIDER - assert options[0].label == "CPU – empfohlen" + assert options[0].label == "CPU – recommended" assert options[1].label == "Apple CoreML – experimentell" assert options[1].recommended is False @@ -91,7 +91,7 @@ def test_windows_directml_is_preselected_without_cuda_or_amd_providers() -> None DML_EXECUTION_PROVIDER, CPU_EXECUTION_PROVIDER, } - assert directml_options[0].label == "GPU over DirectML – empfohlen" + assert directml_options[0].label == "GPU over DirectML – recommended" assert select_provider(None, cuda_options) == CUDA_EXECUTION_PROVIDER diff --git a/tests/core/test_parameters.py b/tests/core/test_parameters.py index 8f3752f..642c3f7 100644 --- a/tests/core/test_parameters.py +++ b/tests/core/test_parameters.py @@ -120,7 +120,7 @@ def test_execution_provider_changes_stale_the_current_preview() -> None: assert changed.parameters.execution_provider == "CUDAExecutionProvider" assert changed.preview is PreviewState.STALE - assert changed.stale_category == "Rechenbeschleunigung" + assert changed.stale_category == "Compute acceleration" def test_cleanup_parameter_changes_stale_the_current_preview() -> None: diff --git a/tests/test_app_smoke.py b/tests/test_app_smoke.py index 6d095c6..b2cf582 100644 --- a/tests/test_app_smoke.py +++ b/tests/test_app_smoke.py @@ -172,7 +172,10 @@ def test_provider_command_prints_fake_runtime_facts( output = capsys.readouterr().out assert "ONNX Runtime distribution: fake 1.2" in output assert "onnxruntime device: GPU" in output - assert "DmlExecutionProvider: GPU over DirectML – empfohlen [recommended]" in output + assert ( + "DmlExecutionProvider: GPU over DirectML – recommended [recommended]" + in output + ) assert "CPUExecutionProvider: CPU" in output diff --git a/tests/ui/test_parameter_inspector.py b/tests/ui/test_parameter_inspector.py index 2958b7e..e954159 100644 --- a/tests/ui/test_parameter_inspector.py +++ b/tests/ui/test_parameter_inspector.py @@ -227,7 +227,7 @@ def test_inspector_exposes_and_emits_the_selected_execution_provider(qtbot) -> N inspector = Inspector( _settings(), provider_options=( - ProviderOption(CPU_EXECUTION_PROVIDER, "CPU – empfohlen", True), + ProviderOption(CPU_EXECUTION_PROVIDER, "CPU – recommended", True), ProviderOption( COREML_EXECUTION_PROVIDER, "Apple CoreML – experimentell", From e0457999f57fd3ba1e3c6bcda67ba33d56f605b4 Mon Sep 17 00:00:00 2001 From: smb Date: Sat, 5 Sep 2026 09:30:44 +0200 Subject: [PATCH 2/2] fix: translate the remaining two German strings in the provider UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first pass on this branch fixed four German strings but left two more, both flagged in review as still user-visible: the "experimental" suffix on the CoreML provider label, and the fallback notice shown when a model can't load on the selected provider. Leaving them meant the inspector's provider picker still mixed German and English labels side by side ("Apple CoreML – experimentell" next to "CPU – recommended"), and the fallback path showed a German sentence in an otherwise English error/notice surface. Changed the "– experimentell" suffix in src/matteloop/core/execution_providers.py to "– experimental", matching the en-dash and spacing of the "– recommended" suffix built in the same function. Changed the CPU-fallback notice in src/matteloop/jobs/segmentation_host.py from "{label} konnte dieses Modell nicht laden. Die Verarbeitung wird automatisch über die CPU fortgesetzt." to "{label} could not load this model. Processing continues on the CPU.", keeping it as an f-string with the provider label in the same position. Updated the tests that asserted on the old German text: tests/ui/test_parameter_inspector.py and tests/core/test_execution_providers.py (the CoreML label), and tests/jobs/models/test_session.py (the fallback notice). Trigger: repro — selecting a BirefNet model on Apple Silicon showed "Apple CoreML – experimentell" in the provider picker, and forcing a model load failure on a non-default provider produced a German fallback notice, both alongside otherwise-English UI text. Co-Authored-By: Claude Opus 5 (1M context) --- src/matteloop/core/execution_providers.py | 2 +- src/matteloop/jobs/segmentation_host.py | 3 +-- tests/core/test_execution_providers.py | 2 +- tests/jobs/models/test_session.py | 2 +- tests/ui/test_parameter_inspector.py | 4 ++-- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/matteloop/core/execution_providers.py b/src/matteloop/core/execution_providers.py index ca13af8..971179a 100644 --- a/src/matteloop/core/execution_providers.py +++ b/src/matteloop/core/execution_providers.py @@ -167,7 +167,7 @@ def _provider_label( ) -> str: label = provider_base_label(provider) if provider == COREML_EXECUTION_PROVIDER and model_id.startswith("birefnet"): - return f"{label} – experimentell" + return f"{label} – experimental" if provider == recommended: return f"{label} – recommended" return label diff --git a/src/matteloop/jobs/segmentation_host.py b/src/matteloop/jobs/segmentation_host.py index 1000659..7bf26a4 100644 --- a/src/matteloop/jobs/segmentation_host.py +++ b/src/matteloop/jobs/segmentation_host.py @@ -1585,8 +1585,7 @@ def _create_cpu_fallback_session( session, inference_kwargs, CPU_EXECUTION_PROVIDER, - f"{label} konnte dieses Modell nicht laden. Die Verarbeitung wird " - "automatisch über die CPU fortgesetzt.", + f"{label} could not load this model. Processing continues on the CPU.", ) diff --git a/tests/core/test_execution_providers.py b/tests/core/test_execution_providers.py index 82301be..c4bb275 100644 --- a/tests/core/test_execution_providers.py +++ b/tests/core/test_execution_providers.py @@ -52,7 +52,7 @@ def test_apple_silicon_prefers_cpu_while_offering_coreml_as_experimental() -> No ] assert select_provider(None, options) == CPU_EXECUTION_PROVIDER assert options[0].label == "CPU – recommended" - assert options[1].label == "Apple CoreML – experimentell" + assert options[1].label == "Apple CoreML – experimental" assert options[1].recommended is False diff --git a/tests/jobs/models/test_session.py b/tests/jobs/models/test_session.py index 8324a29..fd2ff72 100644 --- a/tests/jobs/models/test_session.py +++ b/tests/jobs/models/test_session.py @@ -850,7 +850,7 @@ def InferenceSession( assert isinstance(prepared, _PreparedRembgSession) assert prepared.execution_provider == CPU_EXECUTION_PROVIDER assert prepared.startup_notice is not None - assert "CPU fortgesetzt" in prepared.startup_notice + assert "continues on the CPU" in prepared.startup_notice assert calls == [ [CUDA_EXECUTION_PROVIDER, CPU_EXECUTION_PROVIDER], [CPU_EXECUTION_PROVIDER], diff --git a/tests/ui/test_parameter_inspector.py b/tests/ui/test_parameter_inspector.py index e954159..4284f56 100644 --- a/tests/ui/test_parameter_inspector.py +++ b/tests/ui/test_parameter_inspector.py @@ -230,7 +230,7 @@ def test_inspector_exposes_and_emits_the_selected_execution_provider(qtbot) -> N ProviderOption(CPU_EXECUTION_PROVIDER, "CPU – recommended", True), ProviderOption( COREML_EXECUTION_PROVIDER, - "Apple CoreML – experimentell", + "Apple CoreML – experimental", ), ), ) @@ -239,7 +239,7 @@ def test_inspector_exposes_and_emits_the_selected_execution_provider(qtbot) -> N inspector.command_requested.connect(commands.append) assert inspector.provider_picker.currentData() == CPU_EXECUTION_PROVIDER - assert inspector.provider_picker.itemText(1) == "Apple CoreML – experimentell" + assert inspector.provider_picker.itemText(1) == "Apple CoreML – experimental" inspector.provider_picker.setCurrentIndex(1) assert [type(command).__name__ for command in commands] == [