2121import * as React from 'react' ;
2222import * as Antd from 'antd' ;
2323import { InfoCircleOutlined } from '@ant-design/icons' ;
24+ import { useTranslation } from 'react-i18next' ;
2425
2526declare const __APP_VERSION__ : string ;
2627const __APP_NAME__ = "SystemCore Blocks" ;
@@ -34,8 +35,9 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
3435 visible,
3536 onClose,
3637} ) => {
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' ) ) ;
3941 const attributionsFile = '/attributions.txt' ; // Path to the attributions file
4042
4143 React . useEffect ( ( ) => {
@@ -60,21 +62,21 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
6062 let text = ''
6163
6264 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` ;
6870 text += `\n` ;
6971 } ) ;
7072
7173 setAttributions ( text ) ;
7274 } else {
73- setAttributions ( 'Attributions file not found.' ) ;
75+ setAttributions ( t ( 'ABOUT.ATTRIBUTIONS_NOT_FOUND' ) ) ;
7476 }
7577 } catch ( error ) {
7678 console . error ( 'Error loading attributions:' , error ) ;
77- setAttributions ( 'Error loading attributions.' ) ;
79+ setAttributions ( t ( 'ABOUT.ERROR_LOADING_ATTRIBUTIONS' ) ) ;
7880 }
7981 } ;
8082
@@ -96,11 +98,11 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
9698 } ) ;
9799 setDependencies ( depText ) ;
98100 } else {
99- setDependencies ( 'Dependencies information not available.' ) ;
101+ setDependencies ( t ( 'ABOUT.DEPENDENCIES_NOT_AVAILABLE' ) ) ;
100102 }
101103 } catch ( error ) {
102104 console . error ( 'Error loading dependencies:' , error ) ;
103- setDependencies ( 'Error loading dependencies.' ) ;
105+ setDependencies ( t ( 'ABOUT.ERROR_LOADING_DEPENDENCIES' ) ) ;
104106 }
105107 } ;
106108
@@ -109,11 +111,11 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
109111 title = {
110112 < Antd . Space >
111113 < InfoCircleOutlined />
112- About
114+ { t ( 'ABOUT.TITLE' ) }
113115 </ Antd . Space >
114116 }
115117 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 > ] }
117119 onCancel = { onClose }
118120 onOk = { onClose }
119121 width = { 600 }
@@ -122,7 +124,7 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
122124 < Antd . Space direction = "vertical" style = { { width : '100%' } } size = "small" >
123125 < div >
124126 < 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 >
126128 </ div >
127129
128130 < Antd . Divider style = { { margin : '8px 0' } } />
@@ -131,7 +133,7 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
131133 items = { [
132134 {
133135 key : 'attributions' ,
134- label : 'Third-Party Attributions' ,
136+ label : t ( 'ABOUT.TAB_ATTRIBUTIONS' ) ,
135137 children : (
136138 < Antd . Input . TextArea
137139 value = { attributions }
@@ -147,7 +149,7 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
147149 } ,
148150 {
149151 key : 'dependencies' ,
150- label : 'Dependencies' ,
152+ label : t ( 'ABOUT.TAB_DEPENDENCIES' ) ,
151153 children : (
152154 < Antd . Input . TextArea
153155 value = { dependencies }
@@ -166,7 +168,7 @@ const AboutDialog: React.FC<AboutDialogProps> = ({
166168
167169 < div style = { { textAlign : 'center' , marginTop : '16px' } } >
168170 < Antd . Typography . Text type = "secondary" >
169- © 2025 FIRST. All rights reserved.
171+ { t ( 'ABOUT.COPYRIGHT' ) }
170172 </ Antd . Typography . Text >
171173 </ div >
172174 </ Antd . Space >
0 commit comments