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,12 +1,17 @@
|
||||
{
|
||||
"messages": {
|
||||
"test_run_started": "Test run started...",
|
||||
"failed_to_copy_code": "Failed to copy code",
|
||||
"failed_to_copy_name": "Failed to copy name",
|
||||
"added_to_cart": "Added to cart!",
|
||||
"filters_applied": "Filters applied!",
|
||||
"review_submitted_successfully": "Review submitted successfully!",
|
||||
"thanks_for_your_feedback": "Thanks for your feedback!",
|
||||
"code_copied_to_clipboard": "Code copied to clipboard!"
|
||||
}
|
||||
"messages": {
|
||||
"test_run_started": "Test run started...",
|
||||
"failed_to_copy_code": "Failed to copy code",
|
||||
"failed_to_copy_name": "Failed to copy name",
|
||||
"added_to_cart": "Added to cart!",
|
||||
"filters_applied": "Filters applied!",
|
||||
"review_submitted_successfully": "Review submitted successfully!",
|
||||
"thanks_for_your_feedback": "Thanks for your feedback!",
|
||||
"code_copied_to_clipboard": "Code copied to clipboard!"
|
||||
},
|
||||
"menu": {
|
||||
"developer_tools": "Entwicklerwerkzeuge",
|
||||
"components": "Komponenten",
|
||||
"icons": "Icons"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
{
|
||||
"messages": {
|
||||
"test_run_started": "Test run started...",
|
||||
"failed_to_copy_code": "Failed to copy code",
|
||||
"failed_to_copy_name": "Failed to copy name",
|
||||
"added_to_cart": "Added to cart!",
|
||||
"filters_applied": "Filters applied!",
|
||||
"review_submitted_successfully": "Review submitted successfully!",
|
||||
"thanks_for_your_feedback": "Thanks for your feedback!",
|
||||
"code_copied_to_clipboard": "Code copied to clipboard!"
|
||||
}
|
||||
"messages": {
|
||||
"test_run_started": "Test run started...",
|
||||
"failed_to_copy_code": "Failed to copy code",
|
||||
"failed_to_copy_name": "Failed to copy name",
|
||||
"added_to_cart": "Added to cart!",
|
||||
"filters_applied": "Filters applied!",
|
||||
"review_submitted_successfully": "Review submitted successfully!",
|
||||
"thanks_for_your_feedback": "Thanks for your feedback!",
|
||||
"code_copied_to_clipboard": "Code copied to clipboard!"
|
||||
},
|
||||
"menu": {
|
||||
"developer_tools": "Developer Tools",
|
||||
"components": "Components",
|
||||
"icons": "Icons"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
{
|
||||
"messages": {
|
||||
"test_run_started": "Test run started...",
|
||||
"failed_to_copy_code": "Failed to copy code",
|
||||
"failed_to_copy_name": "Failed to copy name",
|
||||
"added_to_cart": "Added to cart!",
|
||||
"filters_applied": "Filters applied!",
|
||||
"review_submitted_successfully": "Review submitted successfully!",
|
||||
"thanks_for_your_feedback": "Thanks for your feedback!",
|
||||
"code_copied_to_clipboard": "Code copied to clipboard!"
|
||||
}
|
||||
"messages": {
|
||||
"test_run_started": "Test run started...",
|
||||
"failed_to_copy_code": "Failed to copy code",
|
||||
"failed_to_copy_name": "Failed to copy name",
|
||||
"added_to_cart": "Added to cart!",
|
||||
"filters_applied": "Filters applied!",
|
||||
"review_submitted_successfully": "Review submitted successfully!",
|
||||
"thanks_for_your_feedback": "Thanks for your feedback!",
|
||||
"code_copied_to_clipboard": "Code copied to clipboard!"
|
||||
},
|
||||
"menu": {
|
||||
"developer_tools": "Outils de développement",
|
||||
"components": "Composants",
|
||||
"icons": "Icônes"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
{
|
||||
"messages": {
|
||||
"test_run_started": "Test run started...",
|
||||
"failed_to_copy_code": "Failed to copy code",
|
||||
"failed_to_copy_name": "Failed to copy name",
|
||||
"added_to_cart": "Added to cart!",
|
||||
"filters_applied": "Filters applied!",
|
||||
"review_submitted_successfully": "Review submitted successfully!",
|
||||
"thanks_for_your_feedback": "Thanks for your feedback!",
|
||||
"code_copied_to_clipboard": "Code copied to clipboard!"
|
||||
}
|
||||
"messages": {
|
||||
"test_run_started": "Test run started...",
|
||||
"failed_to_copy_code": "Failed to copy code",
|
||||
"failed_to_copy_name": "Failed to copy name",
|
||||
"added_to_cart": "Added to cart!",
|
||||
"filters_applied": "Filters applied!",
|
||||
"review_submitted_successfully": "Review submitted successfully!",
|
||||
"thanks_for_your_feedback": "Thanks for your feedback!",
|
||||
"code_copied_to_clipboard": "Code copied to clipboard!"
|
||||
},
|
||||
"menu": {
|
||||
"developer_tools": "Entwécklerwerkzäicher",
|
||||
"components": "Komponenten",
|
||||
"icons": "Icons"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user