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:
2026-02-07 23:37:13 +01:00
parent faf7047979
commit dad02695f6
54 changed files with 3924 additions and 3549 deletions

View File

@@ -1,72 +1,81 @@
{
"loyalty": {
"module": {
"name": "Treueprogramme",
"description": "Stempel- und punktebasierte Treueprogramme mit Wallet-Integration"
"loyalty": {
"module": {
"name": "Treueprogramme",
"description": "Stempel- und punktebasierte Treueprogramme mit Wallet-Integration"
},
"program": {
"title": "Treueprogramm",
"create": "Programm erstellen",
"edit": "Programm bearbeiten",
"activate": "Aktivieren",
"deactivate": "Deaktivieren",
"type": {
"stamps": "Stempel",
"points": "Punkte",
"hybrid": "Hybrid"
}
},
"card": {
"title": "Treuekarte",
"number": "Kartennummer",
"qr_code": "QR-Code",
"enroll": "Kunde anmelden",
"deactivate": "Karte deaktivieren"
},
"stamp": {
"title": "Stempel",
"add": "Stempel hinzufügen",
"redeem": "Prämie einlösen",
"count": "{current} von {target}",
"until_reward": "Noch {count} bis zur Prämie"
},
"points": {
"title": "Punkte",
"earn": "Punkte sammeln",
"redeem": "Punkte einlösen",
"balance": "{count} Punkte",
"per_euro": "{points} Punkte pro Euro"
},
"pin": {
"title": "Mitarbeiter-PINs",
"create": "PIN erstellen",
"edit": "PIN bearbeiten",
"unlock": "PIN entsperren",
"locked": "PIN gesperrt bis {time}"
},
"wallet": {
"google": "Zu Google Wallet hinzufügen",
"apple": "Zu Apple Wallet hinzufügen"
},
"stats": {
"title": "Statistiken",
"total_cards": "Karten insgesamt",
"active_cards": "Aktive Karten",
"stamps_issued": "Ausgegebene Stempel",
"rewards_redeemed": "Eingelöste Prämien"
},
"errors": {
"program_not_found": "Treueprogramm nicht gefunden",
"program_inactive": "Treueprogramm ist nicht aktiv",
"card_not_found": "Treuekarte nicht gefunden",
"card_inactive": "Treuekarte ist nicht aktiv",
"cooldown": "Bitte warten Sie {minutes} Minuten vor dem nächsten Stempel",
"daily_limit": "Tageslimit von {limit} Stempeln erreicht",
"insufficient_stamps": "Benötigt {required} Stempel, vorhanden {current}",
"insufficient_points": "Benötigt {required} Punkte, vorhanden {current}",
"pin_required": "Mitarbeiter-PIN erforderlich",
"pin_invalid": "Ungültiger PIN",
"pin_locked": "PIN wegen zu vieler Fehlversuche gesperrt"
}
},
"program": {
"title": "Treueprogramm",
"create": "Programm erstellen",
"edit": "Programm bearbeiten",
"activate": "Aktivieren",
"deactivate": "Deaktivieren",
"type": {
"stamps": "Stempel",
"points": "Punkte",
"hybrid": "Hybrid"
}
},
"card": {
"title": "Treuekarte",
"number": "Kartennummer",
"qr_code": "QR-Code",
"enroll": "Kunde anmelden",
"deactivate": "Karte deaktivieren"
},
"stamp": {
"title": "Stempel",
"add": "Stempel hinzufügen",
"redeem": "Prämie einlösen",
"count": "{current} von {target}",
"until_reward": "Noch {count} bis zur Prämie"
},
"points": {
"title": "Punkte",
"earn": "Punkte sammeln",
"redeem": "Punkte einlösen",
"balance": "{count} Punkte",
"per_euro": "{points} Punkte pro Euro"
},
"pin": {
"title": "Mitarbeiter-PINs",
"create": "PIN erstellen",
"edit": "PIN bearbeiten",
"unlock": "PIN entsperren",
"locked": "PIN gesperrt bis {time}"
},
"wallet": {
"google": "Zu Google Wallet hinzufügen",
"apple": "Zu Apple Wallet hinzufügen"
},
"stats": {
"title": "Statistiken",
"total_cards": "Karten insgesamt",
"active_cards": "Aktive Karten",
"stamps_issued": "Ausgegebene Stempel",
"rewards_redeemed": "Eingelöste Prämien"
},
"errors": {
"program_not_found": "Treueprogramm nicht gefunden",
"program_inactive": "Treueprogramm ist nicht aktiv",
"card_not_found": "Treuekarte nicht gefunden",
"card_inactive": "Treuekarte ist nicht aktiv",
"cooldown": "Bitte warten Sie {minutes} Minuten vor dem nächsten Stempel",
"daily_limit": "Tageslimit von {limit} Stempeln erreicht",
"insufficient_stamps": "Benötigt {required} Stempel, vorhanden {current}",
"insufficient_points": "Benötigt {required} Punkte, vorhanden {current}",
"pin_required": "Mitarbeiter-PIN erforderlich",
"pin_invalid": "Ungültiger PIN",
"pin_locked": "PIN wegen zu vieler Fehlversuche gesperrt"
"menu": {
"loyalty": "Treueprogramm",
"loyalty_programs": "Treueprogramme",
"programs": "Programme",
"analytics": "Analytik",
"dashboard": "Dashboard",
"customer_cards": "Kundenkarten",
"statistics": "Statistiken"
}
}
}

View File

@@ -1,72 +1,81 @@
{
"loyalty": {
"module": {
"name": "Loyalty Programs",
"description": "Stamp-based and points-based loyalty programs with wallet integration"
"loyalty": {
"module": {
"name": "Loyalty Programs",
"description": "Stamp-based and points-based loyalty programs with wallet integration"
},
"program": {
"title": "Loyalty Program",
"create": "Create Program",
"edit": "Edit Program",
"activate": "Activate",
"deactivate": "Deactivate",
"type": {
"stamps": "Stamps",
"points": "Points",
"hybrid": "Hybrid"
}
},
"card": {
"title": "Loyalty Card",
"number": "Card Number",
"qr_code": "QR Code",
"enroll": "Enroll Customer",
"deactivate": "Deactivate Card"
},
"stamp": {
"title": "Stamps",
"add": "Add Stamp",
"redeem": "Redeem Reward",
"count": "{current} of {target}",
"until_reward": "{count} until reward"
},
"points": {
"title": "Points",
"earn": "Earn Points",
"redeem": "Redeem Points",
"balance": "{count} points",
"per_euro": "{points} points per euro"
},
"pin": {
"title": "Staff PINs",
"create": "Create PIN",
"edit": "Edit PIN",
"unlock": "Unlock PIN",
"locked": "PIN locked until {time}"
},
"wallet": {
"google": "Add to Google Wallet",
"apple": "Add to Apple Wallet"
},
"stats": {
"title": "Statistics",
"total_cards": "Total Cards",
"active_cards": "Active Cards",
"stamps_issued": "Stamps Issued",
"rewards_redeemed": "Rewards Redeemed"
},
"errors": {
"program_not_found": "Loyalty program not found",
"program_inactive": "Loyalty program is not active",
"card_not_found": "Loyalty card not found",
"card_inactive": "Loyalty card is not active",
"cooldown": "Please wait {minutes} minutes before next stamp",
"daily_limit": "Daily stamp limit of {limit} reached",
"insufficient_stamps": "Need {required} stamps, have {current}",
"insufficient_points": "Need {required} points, have {current}",
"pin_required": "Staff PIN is required",
"pin_invalid": "Invalid staff PIN",
"pin_locked": "PIN locked due to too many failed attempts"
}
},
"program": {
"title": "Loyalty Program",
"create": "Create Program",
"edit": "Edit Program",
"activate": "Activate",
"deactivate": "Deactivate",
"type": {
"stamps": "Stamps",
"points": "Points",
"hybrid": "Hybrid"
}
},
"card": {
"title": "Loyalty Card",
"number": "Card Number",
"qr_code": "QR Code",
"enroll": "Enroll Customer",
"deactivate": "Deactivate Card"
},
"stamp": {
"title": "Stamps",
"add": "Add Stamp",
"redeem": "Redeem Reward",
"count": "{current} of {target}",
"until_reward": "{count} until reward"
},
"points": {
"title": "Points",
"earn": "Earn Points",
"redeem": "Redeem Points",
"balance": "{count} points",
"per_euro": "{points} points per euro"
},
"pin": {
"title": "Staff PINs",
"create": "Create PIN",
"edit": "Edit PIN",
"unlock": "Unlock PIN",
"locked": "PIN locked until {time}"
},
"wallet": {
"google": "Add to Google Wallet",
"apple": "Add to Apple Wallet"
},
"stats": {
"title": "Statistics",
"total_cards": "Total Cards",
"active_cards": "Active Cards",
"stamps_issued": "Stamps Issued",
"rewards_redeemed": "Rewards Redeemed"
},
"errors": {
"program_not_found": "Loyalty program not found",
"program_inactive": "Loyalty program is not active",
"card_not_found": "Loyalty card not found",
"card_inactive": "Loyalty card is not active",
"cooldown": "Please wait {minutes} minutes before next stamp",
"daily_limit": "Daily stamp limit of {limit} reached",
"insufficient_stamps": "Need {required} stamps, have {current}",
"insufficient_points": "Need {required} points, have {current}",
"pin_required": "Staff PIN is required",
"pin_invalid": "Invalid staff PIN",
"pin_locked": "PIN locked due to too many failed attempts"
"menu": {
"loyalty": "Loyalty",
"loyalty_programs": "Loyalty Programs",
"programs": "Programs",
"analytics": "Analytics",
"dashboard": "Dashboard",
"customer_cards": "Customer Cards",
"statistics": "Statistics"
}
}
}

View File

@@ -1,72 +1,81 @@
{
"loyalty": {
"module": {
"name": "Programmes de Fidélité",
"description": "Programmes de fidélité par tampons et points avec intégration wallet"
"loyalty": {
"module": {
"name": "Programmes de Fidélité",
"description": "Programmes de fidélité par tampons et points avec intégration wallet"
},
"program": {
"title": "Programme de Fidélité",
"create": "Créer un Programme",
"edit": "Modifier le Programme",
"activate": "Activer",
"deactivate": "Désactiver",
"type": {
"stamps": "Tampons",
"points": "Points",
"hybrid": "Hybride"
}
},
"card": {
"title": "Carte de Fidélité",
"number": "Numéro de Carte",
"qr_code": "Code QR",
"enroll": "Inscrire un Client",
"deactivate": "Désactiver la Carte"
},
"stamp": {
"title": "Tampons",
"add": "Ajouter un Tampon",
"redeem": "Échanger la Récompense",
"count": "{current} sur {target}",
"until_reward": "Plus que {count} pour la récompense"
},
"points": {
"title": "Points",
"earn": "Gagner des Points",
"redeem": "Échanger des Points",
"balance": "{count} points",
"per_euro": "{points} points par euro"
},
"pin": {
"title": "Codes PIN du Personnel",
"create": "Créer un PIN",
"edit": "Modifier le PIN",
"unlock": "Débloquer le PIN",
"locked": "PIN bloqué jusqu'à {time}"
},
"wallet": {
"google": "Ajouter à Google Wallet",
"apple": "Ajouter à Apple Wallet"
},
"stats": {
"title": "Statistiques",
"total_cards": "Total des Cartes",
"active_cards": "Cartes Actives",
"stamps_issued": "Tampons Émis",
"rewards_redeemed": "Récompenses Échangées"
},
"errors": {
"program_not_found": "Programme de fidélité introuvable",
"program_inactive": "Le programme de fidélité n'est pas actif",
"card_not_found": "Carte de fidélité introuvable",
"card_inactive": "La carte de fidélité n'est pas active",
"cooldown": "Veuillez attendre {minutes} minutes avant le prochain tampon",
"daily_limit": "Limite quotidienne de {limit} tampons atteinte",
"insufficient_stamps": "Il faut {required} tampons, vous en avez {current}",
"insufficient_points": "Il faut {required} points, vous en avez {current}",
"pin_required": "Le code PIN du personnel est requis",
"pin_invalid": "Code PIN invalide",
"pin_locked": "PIN bloqué suite à trop de tentatives échouées"
}
},
"program": {
"title": "Programme de Fidélité",
"create": "Créer un Programme",
"edit": "Modifier le Programme",
"activate": "Activer",
"deactivate": "Désactiver",
"type": {
"stamps": "Tampons",
"points": "Points",
"hybrid": "Hybride"
}
},
"card": {
"title": "Carte de Fidélité",
"number": "Numéro de Carte",
"qr_code": "Code QR",
"enroll": "Inscrire un Client",
"deactivate": "Désactiver la Carte"
},
"stamp": {
"title": "Tampons",
"add": "Ajouter un Tampon",
"redeem": "Échanger la Récompense",
"count": "{current} sur {target}",
"until_reward": "Plus que {count} pour la récompense"
},
"points": {
"title": "Points",
"earn": "Gagner des Points",
"redeem": "Échanger des Points",
"balance": "{count} points",
"per_euro": "{points} points par euro"
},
"pin": {
"title": "Codes PIN du Personnel",
"create": "Créer un PIN",
"edit": "Modifier le PIN",
"unlock": "Débloquer le PIN",
"locked": "PIN bloqué jusqu'à {time}"
},
"wallet": {
"google": "Ajouter à Google Wallet",
"apple": "Ajouter à Apple Wallet"
},
"stats": {
"title": "Statistiques",
"total_cards": "Total des Cartes",
"active_cards": "Cartes Actives",
"stamps_issued": "Tampons Émis",
"rewards_redeemed": "Récompenses Échangées"
},
"errors": {
"program_not_found": "Programme de fidélité introuvable",
"program_inactive": "Le programme de fidélité n'est pas actif",
"card_not_found": "Carte de fidélité introuvable",
"card_inactive": "La carte de fidélité n'est pas active",
"cooldown": "Veuillez attendre {minutes} minutes avant le prochain tampon",
"daily_limit": "Limite quotidienne de {limit} tampons atteinte",
"insufficient_stamps": "Il faut {required} tampons, vous en avez {current}",
"insufficient_points": "Il faut {required} points, vous en avez {current}",
"pin_required": "Le code PIN du personnel est requis",
"pin_invalid": "Code PIN invalide",
"pin_locked": "PIN bloqué suite à trop de tentatives échouées"
"menu": {
"loyalty": "Fidélité",
"loyalty_programs": "Programmes de fidélité",
"programs": "Programmes",
"analytics": "Analytique",
"dashboard": "Tableau de bord",
"customer_cards": "Cartes clients",
"statistics": "Statistiques"
}
}
}

View File

@@ -1,72 +1,81 @@
{
"loyalty": {
"module": {
"name": "Treieprogrammer",
"description": "Stempel- a Punktebaséiert Treieprogrammer mat Wallet-Integratioun"
"loyalty": {
"module": {
"name": "Treieprogrammer",
"description": "Stempel- a Punktebaséiert Treieprogrammer mat Wallet-Integratioun"
},
"program": {
"title": "Treieprogramm",
"create": "Programm erstellen",
"edit": "Programm beaarbechten",
"activate": "Aktivéieren",
"deactivate": "Deaktivéieren",
"type": {
"stamps": "Stempelen",
"points": "Punkten",
"hybrid": "Hybrid"
}
},
"card": {
"title": "Treiekaart",
"number": "Kaartnummer",
"qr_code": "QR-Code",
"enroll": "Client aschreiben",
"deactivate": "Kaart deaktivéieren"
},
"stamp": {
"title": "Stempelen",
"add": "Stempel derbäisetzen",
"redeem": "Belounung aléisen",
"count": "{current} vun {target}",
"until_reward": "{count} bis zur Belounung"
},
"points": {
"title": "Punkten",
"earn": "Punkten sammelen",
"redeem": "Punkten aléisen",
"balance": "{count} Punkten",
"per_euro": "{points} Punkten pro Euro"
},
"pin": {
"title": "Personal-PINen",
"create": "PIN erstellen",
"edit": "PIN beaarbechten",
"unlock": "PIN entspären",
"locked": "PIN gespaart bis {time}"
},
"wallet": {
"google": "An Google Wallet derbäisetzen",
"apple": "An Apple Wallet derbäisetzen"
},
"stats": {
"title": "Statistiken",
"total_cards": "Total Kaarten",
"active_cards": "Aktiv Kaarten",
"stamps_issued": "Stempelen ausgestallt",
"rewards_redeemed": "Belounungen agelées"
},
"errors": {
"program_not_found": "Treieprogramm net fonnt",
"program_inactive": "Treieprogramm ass net aktiv",
"card_not_found": "Treiekaart net fonnt",
"card_inactive": "Treiekaart ass net aktiv",
"cooldown": "W.e.g. waart {minutes} Minutten virum nächste Stempel",
"daily_limit": "Deeglecht Stempel-Limit vun {limit} erreecht",
"insufficient_stamps": "Brauch {required} Stempelen, huet {current}",
"insufficient_points": "Brauch {required} Punkten, huet {current}",
"pin_required": "Personal-PIN erfuerderlech",
"pin_invalid": "Ongëlteg Personal-PIN",
"pin_locked": "PIN gespaart wéinst ze vill Fehlversich"
}
},
"program": {
"title": "Treieprogramm",
"create": "Programm erstellen",
"edit": "Programm beaarbechten",
"activate": "Aktivéieren",
"deactivate": "Deaktivéieren",
"type": {
"stamps": "Stempelen",
"points": "Punkten",
"hybrid": "Hybrid"
}
},
"card": {
"title": "Treiekaart",
"number": "Kaartnummer",
"qr_code": "QR-Code",
"enroll": "Client aschreiben",
"deactivate": "Kaart deaktivéieren"
},
"stamp": {
"title": "Stempelen",
"add": "Stempel derbäisetzen",
"redeem": "Belounung aléisen",
"count": "{current} vun {target}",
"until_reward": "{count} bis zur Belounung"
},
"points": {
"title": "Punkten",
"earn": "Punkten sammelen",
"redeem": "Punkten aléisen",
"balance": "{count} Punkten",
"per_euro": "{points} Punkten pro Euro"
},
"pin": {
"title": "Personal-PINen",
"create": "PIN erstellen",
"edit": "PIN beaarbechten",
"unlock": "PIN entspären",
"locked": "PIN gespaart bis {time}"
},
"wallet": {
"google": "An Google Wallet derbäisetzen",
"apple": "An Apple Wallet derbäisetzen"
},
"stats": {
"title": "Statistiken",
"total_cards": "Total Kaarten",
"active_cards": "Aktiv Kaarten",
"stamps_issued": "Stempelen ausgestallt",
"rewards_redeemed": "Belounungen agelées"
},
"errors": {
"program_not_found": "Treieprogramm net fonnt",
"program_inactive": "Treieprogramm ass net aktiv",
"card_not_found": "Treiekaart net fonnt",
"card_inactive": "Treiekaart ass net aktiv",
"cooldown": "W.e.g. waart {minutes} Minutten virum nächste Stempel",
"daily_limit": "Deeglecht Stempel-Limit vun {limit} erreecht",
"insufficient_stamps": "Brauch {required} Stempelen, huet {current}",
"insufficient_points": "Brauch {required} Punkten, huet {current}",
"pin_required": "Personal-PIN erfuerderlech",
"pin_invalid": "Ongëlteg Personal-PIN",
"pin_locked": "PIN gespaart wéinst ze vill Fehlversich"
"menu": {
"loyalty": "Treiprogramm",
"loyalty_programs": "Treiprogrammer",
"programs": "Programmer",
"analytics": "Analytik",
"dashboard": "Dashboard",
"customer_cards": "Clientekaarten",
"statistics": "Statistiken"
}
}
}