1- import { useState } from 'react' ;
1+ import { useMemo , useState } from 'react' ;
22import { useLocation , useNavigate } from 'react-router-dom' ;
33
4+ import { useT } from '../lib/i18n/I18nContext' ;
45// [#1123] Commented out — welcome-agent onboarding replaced by Joyride walkthrough
56// import { isWelcomeLocked } from '../lib/coreState/store';
67import { useCoreState } from '../providers/CoreStateProvider' ;
78import { useAppSelector } from '../store/hooks' ;
89import { selectUnreadCount } from '../store/notificationSlice' ;
910import { isAccountsFullscreen } from '../utils/accountsFullscreen' ;
1011
11- const tabs = [
12+ const makeTabs = ( t : ( key : string ) => string ) => [
1213 {
1314 id : 'home' ,
14- label : 'Home' ,
15+ label : t ( 'nav.home' ) ,
1516 path : '/home' ,
1617 icon : (
1718 < svg className = "w-4 h-4" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
@@ -26,7 +27,7 @@ const tabs = [
2627 } ,
2728 {
2829 id : 'human' ,
29- label : 'Human' ,
30+ label : t ( 'nav.human' ) ,
3031 path : '/human' ,
3132 icon : (
3233 < svg className = "w-4 h-4" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
@@ -41,7 +42,7 @@ const tabs = [
4142 } ,
4243 {
4344 id : 'chat' ,
44- label : 'Chat' ,
45+ label : t ( 'nav.chat' ) ,
4546 path : '/chat' ,
4647 icon : (
4748 < svg className = "w-4 h-4" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
@@ -56,7 +57,7 @@ const tabs = [
5657 } ,
5758 {
5859 id : 'skills' ,
59- label : 'Connections' ,
60+ label : t ( 'nav.connections' ) ,
6061 path : '/skills' ,
6162 icon : (
6263 < svg className = "w-4 h-4" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
@@ -71,7 +72,7 @@ const tabs = [
7172 } ,
7273 {
7374 id : 'intelligence' ,
74- label : 'Memory' ,
75+ label : t ( 'nav.memory' ) ,
7576 path : '/intelligence' ,
7677 icon : (
7778 < svg className = "w-4 h-4" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
@@ -86,7 +87,7 @@ const tabs = [
8687 } ,
8788 {
8889 id : 'notifications' ,
89- label : 'Alerts' ,
90+ label : t ( 'nav.alerts' ) ,
9091 path : '/notifications' ,
9192 icon : (
9293 < svg className = "w-4 h-4" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
@@ -101,7 +102,7 @@ const tabs = [
101102 } ,
102103 {
103104 id : 'rewards' ,
104- label : 'Rewards' ,
105+ label : t ( 'nav.rewards' ) ,
105106 path : '/rewards' ,
106107 icon : (
107108 < svg className = "w-5 h-5" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
@@ -116,7 +117,7 @@ const tabs = [
116117 } ,
117118 {
118119 id : 'settings' ,
119- label : 'Settings' ,
120+ label : t ( 'nav.settings' ) ,
120121 path : '/settings' ,
121122 icon : (
122123 < svg className = "w-4 h-4" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
@@ -138,6 +139,8 @@ const tabs = [
138139] ;
139140
140141const BottomTabBar = ( ) => {
142+ const { t } = useT ( ) ;
143+ const tabs = useMemo ( ( ) => makeTabs ( t ) , [ t ] ) ;
141144 const location = useLocation ( ) ;
142145 const navigate = useNavigate ( ) ;
143146 const { snapshot } = useCoreState ( ) ;
@@ -230,7 +233,7 @@ const BottomTabBar = () => {
230233 } `}
231234 aria-label = {
232235 tab . id === 'notifications' && unreadCount > 0
233- ? `${ tab . label } (${ unreadCount } unread)`
236+ ? `${ tab . label } (${ unreadCount } ${ t ( 'alerts. unread' ) } )`
234237 : tab . label
235238 } >
236239 < span className = "relative inline-flex flex-shrink-0" >
0 commit comments