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
This commit is contained in:
@@ -103,6 +103,10 @@ const adminNavigation = [
|
|||||||
export default function Sidebar({ className }: SidebarProps) {
|
export default function Sidebar({ className }: SidebarProps) {
|
||||||
const [location] = useLocation();
|
const [location] = useLocation();
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const navigation = getNavigation(t);
|
||||||
|
const managementNavigation = getManagementNavigation(t);
|
||||||
|
|
||||||
const isActive = (href: string) => {
|
const isActive = (href: string) => {
|
||||||
if (href === "/dashboard") {
|
if (href === "/dashboard") {
|
||||||
@@ -122,7 +126,7 @@ export default function Sidebar({ className }: SidebarProps) {
|
|||||||
<div className="px-3 py-2">
|
<div className="px-3 py-2">
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<h2 className="mb-2 px-4 text-lg font-semibold tracking-tight">
|
<h2 className="mb-2 px-4 text-lg font-semibold tracking-tight">
|
||||||
Navigation
|
{t('common.navigation') || 'Navigation'}
|
||||||
</h2>
|
</h2>
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
{navigation.map((item) => (
|
{navigation.map((item) => (
|
||||||
@@ -149,7 +153,7 @@ export default function Sidebar({ className }: SidebarProps) {
|
|||||||
|
|
||||||
<div className="px-3 py-2">
|
<div className="px-3 py-2">
|
||||||
<h2 className="mb-2 px-4 text-lg font-semibold tracking-tight">
|
<h2 className="mb-2 px-4 text-lg font-semibold tracking-tight">
|
||||||
Management
|
{t('common.management') || 'Management'}
|
||||||
</h2>
|
</h2>
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
{managementNavigation
|
{managementNavigation
|
||||||
|
|||||||
@@ -19,17 +19,19 @@
|
|||||||
"close": "إغلاق",
|
"close": "إغلاق",
|
||||||
"open": "فتح",
|
"open": "فتح",
|
||||||
"yes": "نعم",
|
"yes": "نعم",
|
||||||
"no": "لا"
|
"no": "لا",
|
||||||
|
"navigation": "التنقل",
|
||||||
|
"management": "الإدارة"
|
||||||
},
|
},
|
||||||
"navigation": {
|
"navigation": {
|
||||||
"dashboard": "لوحة التحكم",
|
"dashboard": "لوحة التحكم",
|
||||||
"tasks": "المهام",
|
"tasks": "المهام",
|
||||||
"finances": "الماليات",
|
"finances": "الماليات",
|
||||||
|
"professionals": "الدليل المهني",
|
||||||
"ai": "المساعد الذكي",
|
"ai": "المساعد الذكي",
|
||||||
"voice": "الصوت",
|
"voice": "الأوامر الصوتية",
|
||||||
"analytics": "التحليلات",
|
"analytics": "التحليلات",
|
||||||
"monitoring": "مراقبة النظام",
|
"monitoring": "مراقبة النظام",
|
||||||
"professionals": "الدليل المهني",
|
|
||||||
"settings": "الإعدادات",
|
"settings": "الإعدادات",
|
||||||
"logout": "تسجيل الخروج",
|
"logout": "تسجيل الخروج",
|
||||||
"profile": "الملف الشخصي"
|
"profile": "الملف الشخصي"
|
||||||
|
|||||||
@@ -19,15 +19,19 @@
|
|||||||
"close": "Close",
|
"close": "Close",
|
||||||
"open": "Open",
|
"open": "Open",
|
||||||
"yes": "Yes",
|
"yes": "Yes",
|
||||||
"no": "No"
|
"no": "No",
|
||||||
|
"navigation": "Navigation",
|
||||||
|
"management": "Management"
|
||||||
},
|
},
|
||||||
"navigation": {
|
"navigation": {
|
||||||
"dashboard": "Dashboard",
|
"dashboard": "Dashboard",
|
||||||
"tasks": "Tasks",
|
"tasks": "Tasks",
|
||||||
"finances": "Finances",
|
"finances": "Finances",
|
||||||
|
"professionals": "Professional Directory",
|
||||||
"ai": "AI Assistant",
|
"ai": "AI Assistant",
|
||||||
"voice": "Voice",
|
"voice": "Voice Commands",
|
||||||
"analytics": "Analytics",
|
"analytics": "Analytics",
|
||||||
|
"monitoring": "System Monitor",
|
||||||
"settings": "Settings",
|
"settings": "Settings",
|
||||||
"logout": "Logout",
|
"logout": "Logout",
|
||||||
"profile": "Profile"
|
"profile": "Profile"
|
||||||
|
|||||||
Reference in New Issue
Block a user