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,54 +1,64 @@
{
"notifications": {
"title": "Benachrichtigungen",
"mark_read": "Als gelesen markieren",
"mark_all_read": "Alle als gelesen markieren",
"no_notifications": "Keine Benachrichtigungen",
"new_order": "Neue Bestellung",
"order_updated": "Bestellung aktualisiert",
"low_stock": "Warnung bei geringem Bestand",
"import_complete": "Import abgeschlossen",
"import_failed": "Import fehlgeschlagen"
},
"messages": {
"failed_to_load_template": "Failed to load template",
"template_saved_successfully": "Template saved successfully",
"reverted_to_platform_default": "Reverted to platform default",
"failed_to_load_preview": "Failed to load preview",
"failed_to_send_test_email": "Failed to send test email",
"failed_to_load_conversations": "Failed to load conversations",
"failed_to_load_conversation": "Failed to load conversation",
"conversation_closed": "Conversation closed",
"failed_to_close_conversation": "Failed to close conversation",
"conversation_reopened": "Conversation reopened",
"failed_to_reopen_conversation": "Failed to reopen conversation",
"conversation_created": "Conversation created",
"notification_marked_as_read": "Notification marked as read",
"all_notifications_marked_as_read": "All notifications marked as read",
"notification_deleted": "Notification deleted",
"notification_settings_saved": "Notification settings saved",
"failed_to_load_templates": "Failed to load templates",
"failed_to_load_recipients": "Failed to load recipients",
"failed_to_load_notifications": "Failed to load notifications",
"failed_to_mark_notification_as_read": "Failed to mark notification as read",
"failed_to_mark_all_as_read": "Failed to mark all as read",
"failed_to_delete_notification": "Failed to delete notification",
"failed_to_load_alerts": "Failed to load alerts",
"alert_resolved_successfully": "Alert resolved successfully",
"failed_to_resolve_alert": "Failed to resolve alert"
},
"features": {
"messaging_basic": {
"name": "Basis-Nachrichten",
"description": "Grundlegende Nachrichtenfunktionalität"
"notifications": {
"title": "Benachrichtigungen",
"mark_read": "Als gelesen markieren",
"mark_all_read": "Alle als gelesen markieren",
"no_notifications": "Keine Benachrichtigungen",
"new_order": "Neue Bestellung",
"order_updated": "Bestellung aktualisiert",
"low_stock": "Warnung bei geringem Bestand",
"import_complete": "Import abgeschlossen",
"import_failed": "Import fehlgeschlagen"
},
"email_templates": {
"name": "E-Mail-Vorlagen",
"description": "Anpassbare E-Mail-Vorlagen"
"messages": {
"failed_to_load_template": "Failed to load template",
"template_saved_successfully": "Template saved successfully",
"reverted_to_platform_default": "Reverted to platform default",
"failed_to_load_preview": "Failed to load preview",
"failed_to_send_test_email": "Failed to send test email",
"failed_to_load_conversations": "Failed to load conversations",
"failed_to_load_conversation": "Failed to load conversation",
"conversation_closed": "Conversation closed",
"failed_to_close_conversation": "Failed to close conversation",
"conversation_reopened": "Conversation reopened",
"failed_to_reopen_conversation": "Failed to reopen conversation",
"conversation_created": "Conversation created",
"notification_marked_as_read": "Notification marked as read",
"all_notifications_marked_as_read": "All notifications marked as read",
"notification_deleted": "Notification deleted",
"notification_settings_saved": "Notification settings saved",
"failed_to_load_templates": "Failed to load templates",
"failed_to_load_recipients": "Failed to load recipients",
"failed_to_load_notifications": "Failed to load notifications",
"failed_to_mark_notification_as_read": "Failed to mark notification as read",
"failed_to_mark_all_as_read": "Failed to mark all as read",
"failed_to_delete_notification": "Failed to delete notification",
"failed_to_load_alerts": "Failed to load alerts",
"alert_resolved_successfully": "Alert resolved successfully",
"failed_to_resolve_alert": "Failed to resolve alert"
},
"bulk_messaging": {
"name": "Massennachrichten",
"description": "Massennachrichten an Kunden senden"
"features": {
"messaging_basic": {
"name": "Basis-Nachrichten",
"description": "Grundlegende Nachrichtenfunktionalität"
},
"email_templates": {
"name": "E-Mail-Vorlagen",
"description": "Anpassbare E-Mail-Vorlagen"
},
"bulk_messaging": {
"name": "Massennachrichten",
"description": "Massennachrichten an Kunden senden"
}
},
"menu": {
"platform_admin": "Plattform-Administration",
"platform_monitoring": "Plattform-Überwachung",
"platform_settings": "Plattform-Einstellungen",
"customers": "Kunden",
"account_settings": "Kontoeinstellungen",
"messages": "Nachrichten",
"notifications": "Benachrichtigungen",
"email_templates": "E-Mail-Vorlagen"
}
}
}

View File

@@ -1,63 +1,73 @@
{
"notifications": {
"title": "Notifications",
"mark_read": "Mark as Read",
"mark_all_read": "Mark All as Read",
"no_notifications": "No notifications",
"new_order": "New Order",
"order_updated": "Order Updated",
"low_stock": "Low Stock Alert",
"import_complete": "Import Complete",
"import_failed": "Import Failed"
},
"messages": {
"failed_to_load_template": "Failed to load template",
"template_saved_successfully": "Template saved successfully",
"reverted_to_platform_default": "Reverted to platform default",
"failed_to_load_preview": "Failed to load preview",
"failed_to_send_test_email": "Failed to send test email",
"failed_to_load_conversations": "Failed to load conversations",
"failed_to_load_conversation": "Failed to load conversation",
"conversation_closed": "Conversation closed",
"failed_to_close_conversation": "Failed to close conversation",
"conversation_reopened": "Conversation reopened",
"failed_to_reopen_conversation": "Failed to reopen conversation",
"conversation_created": "Conversation created",
"notification_marked_as_read": "Notification marked as read",
"all_notifications_marked_as_read": "All notifications marked as read",
"notification_deleted": "Notification deleted",
"notification_settings_saved": "Notification settings saved",
"failed_to_load_templates": "Failed to load templates",
"failed_to_load_recipients": "Failed to load recipients",
"failed_to_load_notifications": "Failed to load notifications",
"failed_to_mark_notification_as_read": "Failed to mark notification as read",
"failed_to_mark_all_as_read": "Failed to mark all as read",
"failed_to_delete_notification": "Failed to delete notification",
"failed_to_load_alerts": "Failed to load alerts",
"alert_resolved_successfully": "Alert resolved successfully",
"failed_to_resolve_alert": "Failed to resolve alert",
"no_template_for_language": "No template for {language} - create one by saving",
"failed_to_save_template": "Failed to save template",
"test_email_sent": "Test email sent to {email}"
},
"confirmations": {
"delete_notification": "Are you sure you want to delete this notification?",
"close_conversation": "Close this conversation?",
"close_conversation_admin": "Are you sure you want to close this conversation?",
"delete_customization": "Are you sure you want to delete your customization and revert to the platform default?"
},
"features": {
"messaging_basic": {
"name": "Basic Messaging",
"description": "Basic messaging functionality"
"notifications": {
"title": "Notifications",
"mark_read": "Mark as Read",
"mark_all_read": "Mark All as Read",
"no_notifications": "No notifications",
"new_order": "New Order",
"order_updated": "Order Updated",
"low_stock": "Low Stock Alert",
"import_complete": "Import Complete",
"import_failed": "Import Failed"
},
"email_templates": {
"name": "Email Templates",
"description": "Customizable email templates"
"messages": {
"failed_to_load_template": "Failed to load template",
"template_saved_successfully": "Template saved successfully",
"reverted_to_platform_default": "Reverted to platform default",
"failed_to_load_preview": "Failed to load preview",
"failed_to_send_test_email": "Failed to send test email",
"failed_to_load_conversations": "Failed to load conversations",
"failed_to_load_conversation": "Failed to load conversation",
"conversation_closed": "Conversation closed",
"failed_to_close_conversation": "Failed to close conversation",
"conversation_reopened": "Conversation reopened",
"failed_to_reopen_conversation": "Failed to reopen conversation",
"conversation_created": "Conversation created",
"notification_marked_as_read": "Notification marked as read",
"all_notifications_marked_as_read": "All notifications marked as read",
"notification_deleted": "Notification deleted",
"notification_settings_saved": "Notification settings saved",
"failed_to_load_templates": "Failed to load templates",
"failed_to_load_recipients": "Failed to load recipients",
"failed_to_load_notifications": "Failed to load notifications",
"failed_to_mark_notification_as_read": "Failed to mark notification as read",
"failed_to_mark_all_as_read": "Failed to mark all as read",
"failed_to_delete_notification": "Failed to delete notification",
"failed_to_load_alerts": "Failed to load alerts",
"alert_resolved_successfully": "Alert resolved successfully",
"failed_to_resolve_alert": "Failed to resolve alert",
"no_template_for_language": "No template for {language} - create one by saving",
"failed_to_save_template": "Failed to save template",
"test_email_sent": "Test email sent to {email}"
},
"bulk_messaging": {
"name": "Bulk Messaging",
"description": "Send bulk messages to customers"
"confirmations": {
"delete_notification": "Are you sure you want to delete this notification?",
"close_conversation": "Close this conversation?",
"close_conversation_admin": "Are you sure you want to close this conversation?",
"delete_customization": "Are you sure you want to delete your customization and revert to the platform default?"
},
"features": {
"messaging_basic": {
"name": "Basic Messaging",
"description": "Basic messaging functionality"
},
"email_templates": {
"name": "Email Templates",
"description": "Customizable email templates"
},
"bulk_messaging": {
"name": "Bulk Messaging",
"description": "Send bulk messages to customers"
}
},
"menu": {
"platform_admin": "Platform Admin",
"platform_monitoring": "Platform Monitoring",
"platform_settings": "Platform Settings",
"customers": "Customers",
"account_settings": "Account Settings",
"messages": "Messages",
"notifications": "Notifications",
"email_templates": "Email Templates"
}
}
}

View File

@@ -1,54 +1,64 @@
{
"notifications": {
"title": "Notifications",
"mark_read": "Marquer comme lu",
"mark_all_read": "Tout marquer comme lu",
"no_notifications": "Aucune notification",
"new_order": "Nouvelle commande",
"order_updated": "Commande mise à jour",
"low_stock": "Alerte stock faible",
"import_complete": "Importation terminée",
"import_failed": "Échec de l'importation"
},
"messages": {
"failed_to_load_template": "Failed to load template",
"template_saved_successfully": "Template saved successfully",
"reverted_to_platform_default": "Reverted to platform default",
"failed_to_load_preview": "Failed to load preview",
"failed_to_send_test_email": "Failed to send test email",
"failed_to_load_conversations": "Failed to load conversations",
"failed_to_load_conversation": "Failed to load conversation",
"conversation_closed": "Conversation closed",
"failed_to_close_conversation": "Failed to close conversation",
"conversation_reopened": "Conversation reopened",
"failed_to_reopen_conversation": "Failed to reopen conversation",
"conversation_created": "Conversation created",
"notification_marked_as_read": "Notification marked as read",
"all_notifications_marked_as_read": "All notifications marked as read",
"notification_deleted": "Notification deleted",
"notification_settings_saved": "Notification settings saved",
"failed_to_load_templates": "Failed to load templates",
"failed_to_load_recipients": "Failed to load recipients",
"failed_to_load_notifications": "Failed to load notifications",
"failed_to_mark_notification_as_read": "Failed to mark notification as read",
"failed_to_mark_all_as_read": "Failed to mark all as read",
"failed_to_delete_notification": "Failed to delete notification",
"failed_to_load_alerts": "Failed to load alerts",
"alert_resolved_successfully": "Alert resolved successfully",
"failed_to_resolve_alert": "Failed to resolve alert"
},
"features": {
"messaging_basic": {
"name": "Messagerie de base",
"description": "Fonctionnalité de messagerie de base"
"notifications": {
"title": "Notifications",
"mark_read": "Marquer comme lu",
"mark_all_read": "Tout marquer comme lu",
"no_notifications": "Aucune notification",
"new_order": "Nouvelle commande",
"order_updated": "Commande mise à jour",
"low_stock": "Alerte stock faible",
"import_complete": "Importation terminée",
"import_failed": "Échec de l'importation"
},
"email_templates": {
"name": "Modèles d'e-mail",
"description": "Modèles d'e-mail personnalisables"
"messages": {
"failed_to_load_template": "Failed to load template",
"template_saved_successfully": "Template saved successfully",
"reverted_to_platform_default": "Reverted to platform default",
"failed_to_load_preview": "Failed to load preview",
"failed_to_send_test_email": "Failed to send test email",
"failed_to_load_conversations": "Failed to load conversations",
"failed_to_load_conversation": "Failed to load conversation",
"conversation_closed": "Conversation closed",
"failed_to_close_conversation": "Failed to close conversation",
"conversation_reopened": "Conversation reopened",
"failed_to_reopen_conversation": "Failed to reopen conversation",
"conversation_created": "Conversation created",
"notification_marked_as_read": "Notification marked as read",
"all_notifications_marked_as_read": "All notifications marked as read",
"notification_deleted": "Notification deleted",
"notification_settings_saved": "Notification settings saved",
"failed_to_load_templates": "Failed to load templates",
"failed_to_load_recipients": "Failed to load recipients",
"failed_to_load_notifications": "Failed to load notifications",
"failed_to_mark_notification_as_read": "Failed to mark notification as read",
"failed_to_mark_all_as_read": "Failed to mark all as read",
"failed_to_delete_notification": "Failed to delete notification",
"failed_to_load_alerts": "Failed to load alerts",
"alert_resolved_successfully": "Alert resolved successfully",
"failed_to_resolve_alert": "Failed to resolve alert"
},
"bulk_messaging": {
"name": "Messagerie en masse",
"description": "Envoyer des messages en masse aux clients"
"features": {
"messaging_basic": {
"name": "Messagerie de base",
"description": "Fonctionnalité de messagerie de base"
},
"email_templates": {
"name": "Modèles d'e-mail",
"description": "Modèles d'e-mail personnalisables"
},
"bulk_messaging": {
"name": "Messagerie en masse",
"description": "Envoyer des messages en masse aux clients"
}
},
"menu": {
"platform_admin": "Administration de la plateforme",
"platform_monitoring": "Surveillance de la plateforme",
"platform_settings": "Paramètres de la plateforme",
"customers": "Clients",
"account_settings": "Paramètres du compte",
"messages": "Messages",
"notifications": "Notifications",
"email_templates": "Modèles d'e-mail"
}
}
}

View File

@@ -1,54 +1,64 @@
{
"notifications": {
"title": "Notifikatiounen",
"mark_read": "Als gelies markéieren",
"mark_all_read": "Alles als gelies markéieren",
"no_notifications": "Keng Notifikatiounen",
"new_order": "Nei Bestellung",
"order_updated": "Bestellung aktualiséiert",
"low_stock": "Niddreg Lager Alarm",
"import_complete": "Import fäerdeg",
"import_failed": "Import feelgeschloen"
},
"messages": {
"failed_to_load_template": "Failed to load template",
"template_saved_successfully": "Template saved successfully",
"reverted_to_platform_default": "Reverted to platform default",
"failed_to_load_preview": "Failed to load preview",
"failed_to_send_test_email": "Failed to send test email",
"failed_to_load_conversations": "Failed to load conversations",
"failed_to_load_conversation": "Failed to load conversation",
"conversation_closed": "Conversation closed",
"failed_to_close_conversation": "Failed to close conversation",
"conversation_reopened": "Conversation reopened",
"failed_to_reopen_conversation": "Failed to reopen conversation",
"conversation_created": "Conversation created",
"notification_marked_as_read": "Notification marked as read",
"all_notifications_marked_as_read": "All notifications marked as read",
"notification_deleted": "Notification deleted",
"notification_settings_saved": "Notification settings saved",
"failed_to_load_templates": "Failed to load templates",
"failed_to_load_recipients": "Failed to load recipients",
"failed_to_load_notifications": "Failed to load notifications",
"failed_to_mark_notification_as_read": "Failed to mark notification as read",
"failed_to_mark_all_as_read": "Failed to mark all as read",
"failed_to_delete_notification": "Failed to delete notification",
"failed_to_load_alerts": "Failed to load alerts",
"alert_resolved_successfully": "Alert resolved successfully",
"failed_to_resolve_alert": "Failed to resolve alert"
},
"features": {
"messaging_basic": {
"name": "Basis-Noriichten",
"description": "Grondleeënd Noriichtenfunktiounalitéit"
"notifications": {
"title": "Notifikatiounen",
"mark_read": "Als gelies markéieren",
"mark_all_read": "Alles als gelies markéieren",
"no_notifications": "Keng Notifikatiounen",
"new_order": "Nei Bestellung",
"order_updated": "Bestellung aktualiséiert",
"low_stock": "Niddreg Lager Alarm",
"import_complete": "Import fäerdeg",
"import_failed": "Import feelgeschloen"
},
"email_templates": {
"name": "E-Mail-Virlagen",
"description": "Upassbar E-Mail-Virlagen"
"messages": {
"failed_to_load_template": "Failed to load template",
"template_saved_successfully": "Template saved successfully",
"reverted_to_platform_default": "Reverted to platform default",
"failed_to_load_preview": "Failed to load preview",
"failed_to_send_test_email": "Failed to send test email",
"failed_to_load_conversations": "Failed to load conversations",
"failed_to_load_conversation": "Failed to load conversation",
"conversation_closed": "Conversation closed",
"failed_to_close_conversation": "Failed to close conversation",
"conversation_reopened": "Conversation reopened",
"failed_to_reopen_conversation": "Failed to reopen conversation",
"conversation_created": "Conversation created",
"notification_marked_as_read": "Notification marked as read",
"all_notifications_marked_as_read": "All notifications marked as read",
"notification_deleted": "Notification deleted",
"notification_settings_saved": "Notification settings saved",
"failed_to_load_templates": "Failed to load templates",
"failed_to_load_recipients": "Failed to load recipients",
"failed_to_load_notifications": "Failed to load notifications",
"failed_to_mark_notification_as_read": "Failed to mark notification as read",
"failed_to_mark_all_as_read": "Failed to mark all as read",
"failed_to_delete_notification": "Failed to delete notification",
"failed_to_load_alerts": "Failed to load alerts",
"alert_resolved_successfully": "Alert resolved successfully",
"failed_to_resolve_alert": "Failed to resolve alert"
},
"bulk_messaging": {
"name": "Massennoriichten",
"description": "Massennoriichten u Clienten schécken"
"features": {
"messaging_basic": {
"name": "Basis-Noriichten",
"description": "Grondleeënd Noriichtenfunktiounalitéit"
},
"email_templates": {
"name": "E-Mail-Virlagen",
"description": "Upassbar E-Mail-Virlagen"
},
"bulk_messaging": {
"name": "Massennoriichten",
"description": "Massennoriichten u Clienten schécken"
}
},
"menu": {
"platform_admin": "Plattform-Administratioun",
"platform_monitoring": "Plattform-Iwwerwaachung",
"platform_settings": "Plattform-Astellungen",
"customers": "Clienten",
"account_settings": "Kont-Astellungen",
"messages": "Messagen",
"notifications": "Notifikatiounen",
"email_templates": "E-Mail-Virlagen"
}
}
}