diff --git a/components/app-sidebar.tsx b/components/app-sidebar.tsx index ed84762..ce2113c 100644 --- a/components/app-sidebar.tsx +++ b/components/app-sidebar.tsx @@ -37,7 +37,7 @@ import { useRouter } from "next/navigation" import packageJson from "@/package.json" import { cn } from "@/lib/utils" import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible" - +import { useTranslations } from "next-intl" interface NavItem { title: string icon?: React.ComponentType @@ -46,49 +46,52 @@ interface NavItem { items?: NavItem[] } -const data: { navMain: NavItem[] } = { + + +export function AppSidebar({ ...props }: React.ComponentProps) { + const t = useTranslations('Sidebar') + const data: { navMain: NavItem[] } = { navMain: [ { - title: "Dashboard", + title: t('Dashboard'), icon: LayoutDashboardIcon, url: "/dashboard", }, { - title: "My Infrastructure", + title: t('My Infrastructure'), url: "#", icon: Briefcase, items: [ { - title: "Servers", + title: t('Servers'), icon: Server, url: "/dashboard/servers", }, { - title: "Applications", + title: t('Applications'), icon: AppWindow, url: "/dashboard/applications", }, { - title: "Uptime", + title: t('Uptime'), icon: Activity, url: "/dashboard/uptime", }, { - title: "Network", + title: t('Network'), icon: Network, url: "/dashboard/network", }, ], }, { - title: "Settings", + title: t('Settings'), icon: Settings, url: "/dashboard/settings", }, ], } -export function AppSidebar({ ...props }: React.ComponentProps) { const router = useRouter() const pathname = usePathname() @@ -132,7 +135,7 @@ export function AppSidebar({ ...props }: React.ComponentProps) { - Main Navigation + {t('Main Navigation')} @@ -197,7 +200,7 @@ export function AppSidebar({ ...props }: React.ComponentProps) { onClick={logout} > - Logout + {t('Logout')} diff --git a/i18n/languages/en.json b/i18n/languages/en.json index 5f0c464..8ad5889 100644 --- a/i18n/languages/en.json +++ b/i18n/languages/en.json @@ -1,4 +1,15 @@ { + "Sidebar": { + "Main Navigation": "Main Navigation", + "Dashboard": "Dashboard", + "My Infrastructure": "My Infrastructure", + "Servers": "Servers", + "Applications": "Applications", + "Uptime": "Uptime", + "Network": "Network", + "Settings": "Settings", + "Logout": "Logout" + }, "Home": { "TitleUnder": "Dashboard to manage your entire server infrastructure", "LoginCardTitle": "Login",