21
21
import * as React from 'react' ;
22
22
import * as Antd from 'antd' ;
23
23
import { InfoCircleOutlined } from '@ant-design/icons' ;
24
+ import { useTranslation } from 'react-i18next' ;
24
25
25
26
declare const __APP_VERSION__ : string ;
26
27
const __APP_NAME__ = "SystemCore Blocks" ;
@@ -34,8 +35,9 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
34
35
visible,
35
36
onClose,
36
37
} ) => {
37
- const [ attributions , setAttributions ] = React . useState < string > ( 'Loading attributions...' ) ;
38
- const [ dependencies , setDependencies ] = React . useState < string > ( 'Loading dependencies...' ) ;
38
+ const { t } = useTranslation ( ) ;
39
+ const [ attributions , setAttributions ] = React . useState < string > ( t ( 'ABOUT.LOADING_ATTRIBUTIONS' ) ) ;
40
+ const [ dependencies , setDependencies ] = React . useState < string > ( t ( 'ABOUT.LOADING_DEPENDENCIES' ) ) ;
39
41
const attributionsFile = '/attributions.txt' ; // Path to the attributions file
40
42
41
43
React . useEffect ( ( ) => {
@@ -60,21 +62,21 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
60
62
let text = ''
61
63
62
64
licenses . forEach ( ( licenseData ) => {
63
- text += `Name : ${ licenseData . name } \n` ;
64
- text += `Version : ${ licenseData . version } \n` ;
65
- text += `Authors : ${ licenseData . authors } \n` ;
66
- text += `URL: ${ licenseData . url } \n` ;
67
- text += `License : ${ licenseData . license } \n` ;
65
+ text += `${ t ( 'ABOUT.NAME' ) } : ${ licenseData . name } \n` ;
66
+ text += `${ t ( 'ABOUT.VERSION' ) } : ${ licenseData . version } \n` ;
67
+ text += `${ t ( 'ABOUT.AUTHORS' ) } : ${ licenseData . authors } \n` ;
68
+ text += `${ t ( 'ABOUT. URL' ) } : ${ licenseData . url } \n` ;
69
+ text += `${ t ( 'ABOUT.LICENSE' ) } : ${ licenseData . license } \n` ;
68
70
text += `\n` ;
69
71
} ) ;
70
72
71
73
setAttributions ( text ) ;
72
74
} else {
73
- setAttributions ( 'Attributions file not found.' ) ;
75
+ setAttributions ( t ( 'ABOUT.ATTRIBUTIONS_NOT_FOUND' ) ) ;
74
76
}
75
77
} catch ( error ) {
76
78
console . error ( 'Error loading attributions:' , error ) ;
77
- setAttributions ( 'Error loading attributions.' ) ;
79
+ setAttributions ( t ( 'ABOUT.ERROR_LOADING_ATTRIBUTIONS' ) ) ;
78
80
}
79
81
} ;
80
82
@@ -96,11 +98,11 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
96
98
} ) ;
97
99
setDependencies ( depText ) ;
98
100
} else {
99
- setDependencies ( 'Dependencies information not available.' ) ;
101
+ setDependencies ( t ( 'ABOUT.DEPENDENCIES_NOT_AVAILABLE' ) ) ;
100
102
}
101
103
} catch ( error ) {
102
104
console . error ( 'Error loading dependencies:' , error ) ;
103
- setDependencies ( 'Error loading dependencies.' ) ;
105
+ setDependencies ( t ( 'ABOUT.ERROR_LOADING_DEPENDENCIES' ) ) ;
104
106
}
105
107
} ;
106
108
@@ -109,11 +111,11 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
109
111
title = {
110
112
< Antd . Space >
111
113
< InfoCircleOutlined />
112
- About
114
+ { t ( 'ABOUT.TITLE' ) }
113
115
</ Antd . Space >
114
116
}
115
117
open = { visible }
116
- footer = { [ < Antd . Button key = "submit" onClick = { onClose } > OK </ Antd . Button > ] }
118
+ footer = { [ < Antd . Button key = "submit" onClick = { onClose } > { t ( 'ABOUT.OK' ) } </ Antd . Button > ] }
117
119
onCancel = { onClose }
118
120
onOk = { onClose }
119
121
width = { 600 }
@@ -122,7 +124,7 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
122
124
< Antd . Space direction = "vertical" style = { { width : '100%' } } size = "small" >
123
125
< div >
124
126
< Antd . Typography . Title level = { 4 } > { __APP_NAME__ } </ Antd . Typography . Title >
125
- < Antd . Typography . Text > Version : { __APP_VERSION__ } </ Antd . Typography . Text >
127
+ < Antd . Typography . Text > { t ( 'ABOUT.VERSION' ) } : { __APP_VERSION__ } </ Antd . Typography . Text >
126
128
</ div >
127
129
128
130
< Antd . Divider style = { { margin : '8px 0' } } />
@@ -131,7 +133,7 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
131
133
items = { [
132
134
{
133
135
key : 'attributions' ,
134
- label : 'Third-Party Attributions' ,
136
+ label : t ( 'ABOUT.TAB_ATTRIBUTIONS' ) ,
135
137
children : (
136
138
< Antd . Input . TextArea
137
139
value = { attributions }
@@ -147,7 +149,7 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
147
149
} ,
148
150
{
149
151
key : 'dependencies' ,
150
- label : 'Dependencies' ,
152
+ label : t ( 'ABOUT.TAB_DEPENDENCIES' ) ,
151
153
children : (
152
154
< Antd . Input . TextArea
153
155
value = { dependencies }
@@ -166,7 +168,7 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
166
168
167
169
< div style = { { textAlign : 'center' , marginTop : '16px' } } >
168
170
< Antd . Typography . Text type = "secondary" >
169
- © 2025 FIRST. All rights reserved.
171
+ { t ( 'ABOUT.COPYRIGHT' ) }
170
172
</ Antd . Typography . Text >
171
173
</ div >
172
174
</ Antd . Space >
0 commit comments