@@ -36,6 +36,7 @@ import {
3636 User ,
3737 Users ,
3838} from 'lucide-react' ;
39+ import { useObjectTranslation } from '@object-ui/i18n' ;
3940import {
4041 Sidebar ,
4142 SidebarContent ,
@@ -64,13 +65,14 @@ interface NavItem {
6465}
6566
6667const ACCOUNT_ITEMS : NavItem [ ] = [
67- { to : '/account/profile' , label : 'Profile ' , icon : User } ,
68- { to : '/account/security' , label : 'Security ' , icon : Shield } ,
69- { to : '/account/sessions' , label : 'Sessions ' , icon : Monitor } ,
70- { to : '/account/two-factor' , label : 'Two-Factor ' , icon : ShieldCheck } ,
68+ { to : '/account/profile' , label : 'profile ' , icon : User } ,
69+ { to : '/account/security' , label : 'security ' , icon : Shield } ,
70+ { to : '/account/sessions' , label : 'sessions ' , icon : Monitor } ,
71+ { to : '/account/two-factor' , label : 'twoFactor ' , icon : ShieldCheck } ,
7172] ;
7273
7374export function AccountSidebar ( ) {
75+ const { t } = useObjectTranslation ( ) ;
7476 const { pathname } = useLocation ( ) ;
7577 const { organizations } = useOrganizations ( ) ;
7678
@@ -87,18 +89,18 @@ export function AccountSidebar() {
8789 < Sidebar collapsible = "icon" className = "h-full" >
8890 < SidebarContent >
8991 < SidebarGroup >
90- < SidebarGroupLabel > Account </ SidebarGroupLabel >
92+ < SidebarGroupLabel > { t ( 'sidebar.groups.account' ) } </ SidebarGroupLabel >
9193 < SidebarGroupContent >
9294 < SidebarMenu >
9395 { ACCOUNT_ITEMS . map ( ( item ) => {
9496 const Icon = item . icon ;
9597 const isActive = normalised === item . to || normalised . startsWith ( `${ item . to } /` ) ;
9698 return (
9799 < SidebarMenuItem key = { item . to } >
98- < SidebarMenuButton asChild isActive = { isActive } tooltip = { item . label } >
100+ < SidebarMenuButton asChild isActive = { isActive } tooltip = { t ( `sidebar.items. ${ item . label } ` ) } >
99101 < Link to = { item . to } >
100102 < Icon className = "size-4" />
101- < span > { item . label } </ span >
103+ < span > { t ( `sidebar.items. ${ item . label } ` ) } </ span >
102104 </ Link >
103105 </ SidebarMenuButton >
104106 </ SidebarMenuItem >
@@ -111,18 +113,18 @@ export function AccountSidebar() {
111113 < SidebarSeparator />
112114
113115 < SidebarGroup >
114- < SidebarGroupLabel > Organization </ SidebarGroupLabel >
116+ < SidebarGroupLabel > { t ( 'sidebar.groups.organization' ) } </ SidebarGroupLabel >
115117 < SidebarGroupContent >
116118 < SidebarMenu >
117119 < SidebarMenuItem >
118120 < SidebarMenuButton
119121 asChild
120122 isActive = { pathname === '/organizations' }
121- tooltip = "Overview"
123+ tooltip = { t ( 'sidebar.items.overview' ) }
122124 >
123125 < Link to = "/organizations" >
124126 < Building2 className = "size-4" />
125- < span > Overview </ span >
127+ < span > { t ( 'sidebar.items.overview' ) } </ span >
126128 </ Link >
127129 </ SidebarMenuButton >
128130 </ SidebarMenuItem >
@@ -132,23 +134,23 @@ export function AccountSidebar() {
132134 < SidebarMenuButton
133135 asChild
134136 isActive = { pathname === `/organizations/${ activeOrgId } /general` }
135- tooltip = "General"
137+ tooltip = { t ( 'sidebar.items.general' ) }
136138 >
137139 < Link to = "/organizations/$orgId/general" params = { { orgId : activeOrgId } } >
138140 < Settings className = "size-4" />
139- < span > General </ span >
141+ < span > { t ( 'sidebar.items.general' ) } </ span >
140142 </ Link >
141143 </ SidebarMenuButton >
142144 </ SidebarMenuItem >
143145 < SidebarMenuItem >
144146 < SidebarMenuButton
145147 asChild
146148 isActive = { pathname === `/organizations/${ activeOrgId } /members` }
147- tooltip = "Members"
149+ tooltip = { t ( 'sidebar.items.members' ) }
148150 >
149151 < Link to = "/organizations/$orgId/members" params = { { orgId : activeOrgId } } >
150152 < Users className = "size-4" />
151- < span > Members </ span >
153+ < span > { t ( 'sidebar.items.members' ) } </ span >
152154 </ Link >
153155 </ SidebarMenuButton >
154156 </ SidebarMenuItem >
@@ -161,18 +163,18 @@ export function AccountSidebar() {
161163 < SidebarSeparator />
162164
163165 < SidebarGroup >
164- < SidebarGroupLabel > Developer </ SidebarGroupLabel >
166+ < SidebarGroupLabel > { t ( 'sidebar.groups.developer' ) } </ SidebarGroupLabel >
165167 < SidebarGroupContent >
166168 < SidebarMenu >
167169 < SidebarMenuItem >
168170 < SidebarMenuButton
169171 asChild
170172 isActive = { pathname . startsWith ( '/account/oauth-applications' ) }
171- tooltip = "OAuth Apps"
173+ tooltip = { t ( 'sidebar.items.oauthApps' ) }
172174 >
173175 < Link to = "/account/oauth-applications" >
174176 < KeyRound className = "size-4" />
175- < span > OAuth Apps </ span >
177+ < span > { t ( 'sidebar.items.oauthApps' ) } </ span >
176178 </ Link >
177179 </ SidebarMenuButton >
178180 </ SidebarMenuItem >
@@ -192,13 +194,15 @@ export function AccountSidebar() {
192194}
193195
194196function CollapseButton ( ) {
197+ const { t } = useObjectTranslation ( ) ;
195198 const { state, toggleSidebar } = useSidebar ( ) ;
196199 const collapsed = state === 'collapsed' ;
200+ const label = collapsed ? t ( 'sidebar.expand' ) : t ( 'sidebar.collapse' ) ;
197201 return (
198202 < SidebarMenuButton
199203 onClick = { toggleSidebar }
200- tooltip = { collapsed ? 'Expand sidebar' : 'Collapse sidebar' }
201- aria-label = { collapsed ? 'Expand sidebar' : 'Collapse sidebar' }
204+ tooltip = { label }
205+ aria-label = { label }
202206 >
203207 < PanelLeft className = "size-4" />
204208 </ SidebarMenuButton >
0 commit comments