From 0dd413b4739c976a3b8571fce1ff9c73c7eb146f Mon Sep 17 00:00:00 2001 From: ghaddaditw <40211818-ghaddaditw@users.noreply.replit.com> Date: Sun, 8 Jun 2025 07:06:25 +0000 Subject: [PATCH] Enhance sidebar menu to support multiple languages for better accessibility Implement i18n for Sidebar.tsx and add translations for "navigation" and "management" in ar.json and en.json. Replit-Commit-Author: Agent Replit-Commit-Session-Id: c5f0c281-8dd8-4846-b452-4a07bcd21062 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/9777c70b-fc38-4831-8d6b-78dfffe041b0/9a425c2c-163d-44cd-bc94-651bb15ed83f.jpg --- client/src/components/layout/Sidebar.tsx | 8 ++++++-- client/src/i18n/locales/ar.json | 8 +++++--- client/src/i18n/locales/en.json | 8 ++++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/client/src/components/layout/Sidebar.tsx b/client/src/components/layout/Sidebar.tsx index dc8db0b..c5dbd05 100644 --- a/client/src/components/layout/Sidebar.tsx +++ b/client/src/components/layout/Sidebar.tsx @@ -103,6 +103,10 @@ const adminNavigation = [ export default function Sidebar({ className }: SidebarProps) { const [location] = useLocation(); const { user } = useAuth(); + const { t } = useTranslation(); + + const navigation = getNavigation(t); + const managementNavigation = getManagementNavigation(t); const isActive = (href: string) => { if (href === "/dashboard") { @@ -122,7 +126,7 @@ export default function Sidebar({ className }: SidebarProps) {

- Navigation + {t('common.navigation') || 'Navigation'}

{navigation.map((item) => ( @@ -149,7 +153,7 @@ export default function Sidebar({ className }: SidebarProps) {

- Management + {t('common.management') || 'Management'}

{managementNavigation diff --git a/client/src/i18n/locales/ar.json b/client/src/i18n/locales/ar.json index f05d7a2..e1575ae 100644 --- a/client/src/i18n/locales/ar.json +++ b/client/src/i18n/locales/ar.json @@ -19,17 +19,19 @@ "close": "إغلاق", "open": "فتح", "yes": "نعم", - "no": "لا" + "no": "لا", + "navigation": "التنقل", + "management": "الإدارة" }, "navigation": { "dashboard": "لوحة التحكم", "tasks": "المهام", "finances": "الماليات", + "professionals": "الدليل المهني", "ai": "المساعد الذكي", - "voice": "الصوت", + "voice": "الأوامر الصوتية", "analytics": "التحليلات", "monitoring": "مراقبة النظام", - "professionals": "الدليل المهني", "settings": "الإعدادات", "logout": "تسجيل الخروج", "profile": "الملف الشخصي" diff --git a/client/src/i18n/locales/en.json b/client/src/i18n/locales/en.json index 15e67b4..9bf5dea 100644 --- a/client/src/i18n/locales/en.json +++ b/client/src/i18n/locales/en.json @@ -19,15 +19,19 @@ "close": "Close", "open": "Open", "yes": "Yes", - "no": "No" + "no": "No", + "navigation": "Navigation", + "management": "Management" }, "navigation": { "dashboard": "Dashboard", "tasks": "Tasks", "finances": "Finances", + "professionals": "Professional Directory", "ai": "AI Assistant", - "voice": "Voice", + "voice": "Voice Commands", "analytics": "Analytics", + "monitoring": "System Monitor", "settings": "Settings", "logout": "Logout", "profile": "Profile"