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,79 +1,88 @@
|
||||
{
|
||||
"dashboard": {
|
||||
"title": "Dashboard",
|
||||
"welcome": "Welcome back",
|
||||
"overview": "Overview",
|
||||
"quick_stats": "Quick Stats",
|
||||
"recent_activity": "Recent Activity",
|
||||
"total_products": "Total Products",
|
||||
"total_orders": "Total Orders",
|
||||
"total_customers": "Total Customers",
|
||||
"total_revenue": "Total Revenue",
|
||||
"active_products": "Active Products",
|
||||
"pending_orders": "Pending Orders",
|
||||
"new_customers": "New Customers",
|
||||
"today": "Today",
|
||||
"this_week": "This Week",
|
||||
"this_month": "This Month",
|
||||
"this_year": "This Year",
|
||||
"error_loading": "Error loading dashboard",
|
||||
"no_data": "No data available"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Settings",
|
||||
"general": "General",
|
||||
"store": "Store",
|
||||
"store_name": "Store Name",
|
||||
"store_description": "Store Description",
|
||||
"contact_email": "Contact Email",
|
||||
"contact_phone": "Contact Phone",
|
||||
"business_address": "Business Address",
|
||||
"tax_number": "Tax Number",
|
||||
"currency": "Currency",
|
||||
"timezone": "Timezone",
|
||||
"language": "Language",
|
||||
"language_settings": "Language Settings",
|
||||
"default_language": "Default Language",
|
||||
"dashboard_language": "Dashboard Language",
|
||||
"storefront_language": "Storefront Language",
|
||||
"enabled_languages": "Enabled Languages",
|
||||
"notifications": "Notifications",
|
||||
"email_notifications": "Email Notifications",
|
||||
"integrations": "Integrations",
|
||||
"api_keys": "API Keys",
|
||||
"webhooks": "Webhooks",
|
||||
"save_settings": "Save Settings",
|
||||
"settings_saved": "Settings saved successfully"
|
||||
},
|
||||
"profile": {
|
||||
"title": "Profile",
|
||||
"my_profile": "My Profile",
|
||||
"edit_profile": "Edit Profile",
|
||||
"personal_info": "Personal Information",
|
||||
"first_name": "First Name",
|
||||
"last_name": "Last Name",
|
||||
"email": "Email",
|
||||
"phone": "Phone",
|
||||
"avatar": "Avatar",
|
||||
"change_avatar": "Change Avatar",
|
||||
"security": "Security",
|
||||
"two_factor": "Two-Factor Authentication",
|
||||
"sessions": "Active Sessions",
|
||||
"preferences": "Preferences",
|
||||
"language_preference": "Language Preference",
|
||||
"save_profile": "Save Profile",
|
||||
"profile_updated": "Profile updated successfully"
|
||||
},
|
||||
"messages": {
|
||||
"failed_to_load_dashboard_data": "Failed to load dashboard data",
|
||||
"dashboard_refreshed": "Dashboard refreshed",
|
||||
"item_removed_from_cart": "Item removed from cart",
|
||||
"cart_cleared": "Cart cleared"
|
||||
},
|
||||
"confirmations": {
|
||||
"show_all_menu_items": "This will show all menu items. Continue?",
|
||||
"hide_all_menu_items": "This will hide all menu items (except mandatory ones). You can then enable the ones you want. Continue?",
|
||||
"reset_email_settings": "This will reset all email settings to use .env defaults. Continue?",
|
||||
"cleanup_logs": "This will delete all logs older than {days} days. Continue?"
|
||||
}
|
||||
"dashboard": {
|
||||
"title": "Dashboard",
|
||||
"welcome": "Welcome back",
|
||||
"overview": "Overview",
|
||||
"quick_stats": "Quick Stats",
|
||||
"recent_activity": "Recent Activity",
|
||||
"total_products": "Total Products",
|
||||
"total_orders": "Total Orders",
|
||||
"total_customers": "Total Customers",
|
||||
"total_revenue": "Total Revenue",
|
||||
"active_products": "Active Products",
|
||||
"pending_orders": "Pending Orders",
|
||||
"new_customers": "New Customers",
|
||||
"today": "Today",
|
||||
"this_week": "This Week",
|
||||
"this_month": "This Month",
|
||||
"this_year": "This Year",
|
||||
"error_loading": "Error loading dashboard",
|
||||
"no_data": "No data available"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Settings",
|
||||
"general": "General",
|
||||
"store": "Store",
|
||||
"store_name": "Store Name",
|
||||
"store_description": "Store Description",
|
||||
"contact_email": "Contact Email",
|
||||
"contact_phone": "Contact Phone",
|
||||
"business_address": "Business Address",
|
||||
"tax_number": "Tax Number",
|
||||
"currency": "Currency",
|
||||
"timezone": "Timezone",
|
||||
"language": "Language",
|
||||
"language_settings": "Language Settings",
|
||||
"default_language": "Default Language",
|
||||
"dashboard_language": "Dashboard Language",
|
||||
"storefront_language": "Storefront Language",
|
||||
"enabled_languages": "Enabled Languages",
|
||||
"notifications": "Notifications",
|
||||
"email_notifications": "Email Notifications",
|
||||
"integrations": "Integrations",
|
||||
"api_keys": "API Keys",
|
||||
"webhooks": "Webhooks",
|
||||
"save_settings": "Save Settings",
|
||||
"settings_saved": "Settings saved successfully"
|
||||
},
|
||||
"profile": {
|
||||
"title": "Profile",
|
||||
"my_profile": "My Profile",
|
||||
"edit_profile": "Edit Profile",
|
||||
"personal_info": "Personal Information",
|
||||
"first_name": "First Name",
|
||||
"last_name": "Last Name",
|
||||
"email": "Email",
|
||||
"phone": "Phone",
|
||||
"avatar": "Avatar",
|
||||
"change_avatar": "Change Avatar",
|
||||
"security": "Security",
|
||||
"two_factor": "Two-Factor Authentication",
|
||||
"sessions": "Active Sessions",
|
||||
"preferences": "Preferences",
|
||||
"language_preference": "Language Preference",
|
||||
"save_profile": "Save Profile",
|
||||
"profile_updated": "Profile updated successfully"
|
||||
},
|
||||
"messages": {
|
||||
"failed_to_load_dashboard_data": "Failed to load dashboard data",
|
||||
"dashboard_refreshed": "Dashboard refreshed",
|
||||
"item_removed_from_cart": "Item removed from cart",
|
||||
"cart_cleared": "Cart cleared"
|
||||
},
|
||||
"confirmations": {
|
||||
"show_all_menu_items": "This will show all menu items. Continue?",
|
||||
"hide_all_menu_items": "This will hide all menu items (except mandatory ones). You can then enable the ones you want. Continue?",
|
||||
"reset_email_settings": "This will reset all email settings to use .env defaults. Continue?",
|
||||
"cleanup_logs": "This will delete all logs older than {days} days. Continue?"
|
||||
},
|
||||
"menu": {
|
||||
"dashboard": "Dashboard",
|
||||
"platform_settings": "Platform Settings",
|
||||
"general": "General",
|
||||
"my_menu": "My Menu",
|
||||
"account_settings": "Account Settings",
|
||||
"profile": "Profile",
|
||||
"settings": "Settings"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user