@@ -4,7 +4,8 @@ import { logger } from '../utils/logger';
44 */
55
66import { NavLink , Outlet } from 'react-router-dom' ;
7- import { useEffect , useState } from 'react' ;
7+ import { useEffect , useState } from 'react'
8+ import { useT } from '../i18n/context' ;
89import Breadcrumb from './shared/Breadcrumb' ;
910import { ErrorBoundary } from './shared/ErrorBoundary' ;
1011import { useTheme } from '../hooks/useTheme' ;
@@ -105,6 +106,7 @@ function isMobileSidebarViewport(): boolean {
105106}
106107
107108export default function Layout ( ) {
109+ const t = useT ( ) ;
108110 const sseConnected = useStore ( ( s ) => s . sseConnected ) ;
109111 const setSseConnected = useStore ( ( s ) => s . setSseConnected ) ;
110112 const sseError = useStore ( ( s ) => s . sseError ) ;
@@ -406,7 +408,7 @@ export default function Layout() {
406408
407409 { /* ── Sidebar ─────────────────────────────────────────── */ }
408410 < aside
409- aria-label = "Primary sidebar"
411+ aria-label = { t ( 'aria.primarySidebar' ) }
410412 className = { `
411413 fixed inset-y-0 left-0 z-40 flex flex-col border-r border-white/5 bg-transparent backdrop-blur-xl
412414 transition-all duration-300 ease-in-out
@@ -428,15 +430,15 @@ export default function Layout() {
428430 tabIndex = { hiddenMobileSidebarControlTabIndex }
429431 disabled = { isMobileSidebarHidden }
430432 className = "md:hidden inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-lg text-slate-600 transition-colors hover:bg-slate-100 hover:text-slate-900 dark:text-[var(--color-text-muted)] dark:hover:bg-void-lighter dark:hover:text-[var(--color-text-primary)]"
431- aria-label = "Close menu"
433+ aria-label = { t ( 'aria.closeMenu' ) }
432434 aria-hidden = { isMobileSidebarHidden ? 'true' : undefined }
433435 >
434436 < X className = "h-5 w-5" />
435437 </ button >
436438 </ div >
437439
438440 { /* Nav links */ }
439- < nav className = "flex flex-col gap-4 px-3 py-6 flex-1 overflow-y-auto overflow-x-hidden" aria-label = "Main navigation" >
441+ < nav className = "flex flex-col gap-4 px-3 py-6 flex-1 overflow-y-auto overflow-x-hidden" aria-label = { t ( 'aria.mainNavigation' ) } >
440442 { NAV_GROUPS . map ( ( group ) => (
441443 < div key = { group . label } className = "flex flex-col gap-1" >
442444 { ! isCollapsed && (
@@ -471,7 +473,7 @@ export default function Layout() {
471473 { /* Bottom section: Settings + toggle + logout */ }
472474 < div className = "border-t border-white/5 px-3 py-4 flex flex-col gap-2" >
473475 { identityLabel && identityDetailLabel && ! isCollapsed && (
474- < div className = "px-3 py-2" aria-label = "Signed in user" >
476+ < div className = "px-3 py-2" aria-label = { t ( 'aria.signedInUser' ) } >
475477 < p className = "truncate text-xs font-medium text-slate-700 dark:text-[var(--color-text-primary)]" > { identityLabel } </ p >
476478 < p className = "truncate text-[11px] text-slate-500 dark:text-[var(--color-text-muted)]" >
477479 { identityDetailLabel }
@@ -519,7 +521,7 @@ export default function Layout() {
519521 onClick = { handleLogout }
520522 tabIndex = { hiddenMobileSidebarControlTabIndex }
521523 className = { `flex items-center gap-2.5 rounded-lg px-3 py-3 min-h-[44px] text-sm font-medium text-slate-600 hover:bg-slate-100 hover:text-slate-900 dark:text-[var(--color-text-muted)] dark:hover:bg-void-lighter dark:hover:text-[var(--color-text-primary)] transition-colors w-full ${ isCollapsed ? 'justify-center' : '' } ` }
522- aria-label = "Sign out"
524+ aria-label = { t ( 'aria.signOut' ) }
523525 >
524526 < LogOut className = "h-4 w-4 shrink-0" />
525527 { ! isCollapsed && < span className = "truncate" > Sign out</ span > }
@@ -540,7 +542,7 @@ export default function Layout() {
540542 tabIndex = { isMobileDrawerOpen ? - 1 : undefined }
541543 aria-hidden = { isMobileDrawerOpen ? 'true' : undefined }
542544 className = "md:hidden inline-flex h-11 w-11 items-center justify-center rounded-lg text-slate-600 hover:bg-slate-100 hover:text-slate-900 dark:text-[var(--color-text-muted)] dark:hover:bg-void-lighter dark:hover:text-[var(--color-text-primary)] transition-colors"
543- aria-label = "Open menu"
545+ aria-label = { t ( 'aria.openMenu' ) }
544546 >
545547 < Menu className = "h-5 w-5" />
546548 </ button >
@@ -559,7 +561,7 @@ export default function Layout() {
559561 < button
560562 type = "button"
561563 onClick = { openNewSession }
562- aria-label = "New Session (⌘N)"
564+ aria-label = { t ( 'aria.newSessionCmd' ) }
563565 title = "New Session (⌘N)"
564566 className = "inline-flex h-11 w-11 items-center justify-center rounded-lg p-2.5 min-h-[44px] min-w-[44px] text-slate-600 hover:bg-slate-100 hover:text-slate-900 dark:text-[var(--color-text-muted)] dark:hover:bg-void-lighter dark:hover:text-[var(--color-text-primary)] transition-colors"
565567 >
0 commit comments