fix(i18n): add missing menu translations and fix admin language resolution
Two issues caused the admin sidebar to show a mix of French and English:
1. Only 3 of 14 modules had "menu" translations in their locale files.
When a key was missing, _translate_label() fell back to English Title
Case from the key name — mixing with French from modules that had
translations. Added menu sections to all 4 languages (en, fr, de, lb)
across 13 modules.
2. The language middleware hardcoded admin to "en" ignoring user preference,
while the menu API fell back to DEFAULT_LANGUAGE ("fr") when
preferred_language was NULL. Fixed middleware to respect user's
preferred_language and menu API to use middleware-resolved language
as fallback.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
{
|
||||
"analytics": {
|
||||
"page_title": "Analysen",
|
||||
"dashboard_title": "Analyse-Dashboard",
|
||||
"dashboard_subtitle": "Sehen Sie Ihre Shop-Leistungskennzahlen und Einblicke",
|
||||
"period_7d": "Letzte 7 Tage",
|
||||
"period_30d": "Letzte 30 Tage",
|
||||
"period_90d": "Letzte 90 Tage",
|
||||
"period_1y": "Letztes Jahr",
|
||||
"imports_count": "Importe",
|
||||
"products_added": "Hinzugefügte Produkte",
|
||||
"inventory_locations": "Lagerstandorte",
|
||||
"data_since": "Daten seit",
|
||||
"loading": "Analysen werden geladen...",
|
||||
"error_loading": "Analysedaten konnten nicht geladen werden"
|
||||
}
|
||||
"analytics": {
|
||||
"page_title": "Analysen",
|
||||
"dashboard_title": "Analyse-Dashboard",
|
||||
"dashboard_subtitle": "Sehen Sie Ihre Shop-Leistungskennzahlen und Einblicke",
|
||||
"period_7d": "Letzte 7 Tage",
|
||||
"period_30d": "Letzte 30 Tage",
|
||||
"period_90d": "Letzte 90 Tage",
|
||||
"period_1y": "Letztes Jahr",
|
||||
"imports_count": "Importe",
|
||||
"products_added": "Hinzugefügte Produkte",
|
||||
"inventory_locations": "Lagerstandorte",
|
||||
"data_since": "Daten seit",
|
||||
"loading": "Analysen werden geladen...",
|
||||
"error_loading": "Analysedaten konnten nicht geladen werden"
|
||||
},
|
||||
"menu": {
|
||||
"analytics": "Analytik"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
{
|
||||
"analytics": {
|
||||
"page_title": "Analytics",
|
||||
"dashboard_title": "Analytics Dashboard",
|
||||
"dashboard_subtitle": "View your store performance metrics and insights",
|
||||
"period_7d": "Last 7 days",
|
||||
"period_30d": "Last 30 days",
|
||||
"period_90d": "Last 90 days",
|
||||
"period_1y": "Last year",
|
||||
"imports_count": "Imports",
|
||||
"products_added": "Products Added",
|
||||
"inventory_locations": "Inventory Locations",
|
||||
"data_since": "Data since",
|
||||
"loading": "Loading analytics...",
|
||||
"error_loading": "Failed to load analytics data"
|
||||
}
|
||||
"analytics": {
|
||||
"page_title": "Analytics",
|
||||
"dashboard_title": "Analytics Dashboard",
|
||||
"dashboard_subtitle": "View your store performance metrics and insights",
|
||||
"period_7d": "Last 7 days",
|
||||
"period_30d": "Last 30 days",
|
||||
"period_90d": "Last 90 days",
|
||||
"period_1y": "Last year",
|
||||
"imports_count": "Imports",
|
||||
"products_added": "Products Added",
|
||||
"inventory_locations": "Inventory Locations",
|
||||
"data_since": "Data since",
|
||||
"loading": "Loading analytics...",
|
||||
"error_loading": "Failed to load analytics data"
|
||||
},
|
||||
"menu": {
|
||||
"analytics": "Analytics"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
{
|
||||
"analytics": {
|
||||
"page_title": "Analytique",
|
||||
"dashboard_title": "Tableau de bord analytique",
|
||||
"dashboard_subtitle": "Consultez les indicateurs de performance de votre boutique",
|
||||
"period_7d": "7 derniers jours",
|
||||
"period_30d": "30 derniers jours",
|
||||
"period_90d": "90 derniers jours",
|
||||
"period_1y": "Dernière année",
|
||||
"imports_count": "Importations",
|
||||
"products_added": "Produits ajoutés",
|
||||
"inventory_locations": "Emplacements d'inventaire",
|
||||
"data_since": "Données depuis",
|
||||
"loading": "Chargement des analyses...",
|
||||
"error_loading": "Impossible de charger les données analytiques"
|
||||
}
|
||||
"analytics": {
|
||||
"page_title": "Analytique",
|
||||
"dashboard_title": "Tableau de bord analytique",
|
||||
"dashboard_subtitle": "Consultez les indicateurs de performance de votre boutique",
|
||||
"period_7d": "7 derniers jours",
|
||||
"period_30d": "30 derniers jours",
|
||||
"period_90d": "90 derniers jours",
|
||||
"period_1y": "Dernière année",
|
||||
"imports_count": "Importations",
|
||||
"products_added": "Produits ajoutés",
|
||||
"inventory_locations": "Emplacements d'inventaire",
|
||||
"data_since": "Données depuis",
|
||||
"loading": "Chargement des analyses...",
|
||||
"error_loading": "Impossible de charger les données analytiques"
|
||||
},
|
||||
"menu": {
|
||||
"analytics": "Analytique"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
{
|
||||
"analytics": {
|
||||
"page_title": "Analysen",
|
||||
"dashboard_title": "Analysen Dashboard",
|
||||
"dashboard_subtitle": "Kuckt Är Geschäftsleeschtungsmetriken an Abléck",
|
||||
"period_7d": "Lescht 7 Deeg",
|
||||
"period_30d": "Lescht 30 Deeg",
|
||||
"period_90d": "Lescht 90 Deeg",
|
||||
"period_1y": "Lescht Joer",
|
||||
"imports_count": "Importer",
|
||||
"products_added": "Produkter derbäigesat",
|
||||
"inventory_locations": "Inventar-Standuierter",
|
||||
"data_since": "Daten zënter",
|
||||
"loading": "Analysen lueden...",
|
||||
"error_loading": "Feeler beim Lueden vun den Analysedaten"
|
||||
}
|
||||
"analytics": {
|
||||
"page_title": "Analysen",
|
||||
"dashboard_title": "Analysen Dashboard",
|
||||
"dashboard_subtitle": "Kuckt Är Geschäftsleeschtungsmetriken an Abléck",
|
||||
"period_7d": "Lescht 7 Deeg",
|
||||
"period_30d": "Lescht 30 Deeg",
|
||||
"period_90d": "Lescht 90 Deeg",
|
||||
"period_1y": "Lescht Joer",
|
||||
"imports_count": "Importer",
|
||||
"products_added": "Produkter derbäigesat",
|
||||
"inventory_locations": "Inventar-Standuierter",
|
||||
"data_since": "Daten zënter",
|
||||
"loading": "Analysen lueden...",
|
||||
"error_loading": "Feeler beim Lueden vun den Analysedaten"
|
||||
},
|
||||
"menu": {
|
||||
"analytics": "Analytik"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user