From c18ad6f8e702b0d08782163d6af72c502fa5b149 Mon Sep 17 00:00:00 2001
From: ValueOn AG
Date: Sun, 12 Apr 2026 21:32:19 +0200
Subject: [PATCH] fixed instance nav labels i18n
---
modules/routes/routeSystem.py | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/modules/routes/routeSystem.py b/modules/routes/routeSystem.py
index 6638caec..51ad8d1b 100644
--- a/modules/routes/routeSystem.py
+++ b/modules/routes/routeSystem.py
@@ -137,7 +137,9 @@ def _buildDynamicBlock(
) -> Optional[Dict[str, Any]]:
"""
Build the dynamic features block with mandates, features, and instances.
- Labels are German base texts (i18n keys). Frontend translates via t().
+ View and feature labels use resolveText() for the current request language
+ (same contract as static navigation items in _formatBlockItem).
+ Instance and mandate display names are user-defined and passed through as-is.
Returns None if user has no feature instances.
"""
@@ -199,10 +201,7 @@ def _buildDynamicBlock(
else:
featureLabel = {"de": instance.featureCode, "en": instance.featureCode}
- if isinstance(featureLabel, str):
- resolvedFeatureLabel = featureLabel
- else:
- resolvedFeatureLabel = featureLabel.get("de", featureLabel.get("en", instance.featureCode))
+ resolvedFeatureLabel = resolveText(featureLabel)
featuresMap[featureKey] = {
"uiComponent": f"feature.{instance.featureCode}",
@@ -239,8 +238,8 @@ def _buildDynamicBlock(
# Build path for this view
viewPath = f"/mandates/{mandateId}/{instance.featureCode}/{instance.id}/{viewName}"
- label = uiObj.get("label", {})
- uiLabel = label.get("de", label.get("en", viewName)) if isinstance(label, dict) else label
+ rawViewLabel = uiObj.get("label")
+ uiLabel = resolveText(rawViewLabel) if rawViewLabel not in (None, "") else ""
views.append({
"uiComponent": f"page.feature.{instance.featureCode}.{viewName}",
@@ -473,8 +472,8 @@ def get_navigation(
"""
Get unified navigation structure with blocks.
- All labels are German base texts (i18n keys).
- The frontend translates them via t().
+ Static items and dynamic feature/view labels are resolved with resolveText()
+ for the current request language. User-defined instance/mandate names are raw.
Endpoint: GET /api/navigation
"""