diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index 2cea6220..2cd5fd19 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -71,6 +71,24 @@ "NO_FILES_FOUND": "No {{type}} files found", "MECHANISMS": "Mechanisms", "OPMODES": "OpModes", + "ABOUT": { + "TITLE": "About", + "OK": "OK", + "VERSION": "Version", + "NAME": "Name", + "AUTHORS": "Authors", + "URL": "URL", + "LICENSE": "License", + "TAB_ATTRIBUTIONS": "Third-Party Attributions", + "TAB_DEPENDENCIES": "Dependencies", + "LOADING_ATTRIBUTIONS": "Loading attributions...", + "LOADING_DEPENDENCIES": "Loading dependencies...", + "ATTRIBUTIONS_NOT_FOUND": "Attributions file not found.", + "ERROR_LOADING_ATTRIBUTIONS": "Error loading attributions.", + "DEPENDENCIES_NOT_AVAILABLE": "Dependencies information not available.", + "ERROR_LOADING_DEPENDENCIES": "Error loading dependencies.", + "COPYRIGHT": "© 2025 FIRST. All rights reserved." + }, "BLOCKLY":{ "OF_TYPE": "of type", "WITH": "with", diff --git a/src/i18n/locales/es/translation.json b/src/i18n/locales/es/translation.json index ebb5764c..cacc20ad 100644 --- a/src/i18n/locales/es/translation.json +++ b/src/i18n/locales/es/translation.json @@ -72,6 +72,24 @@ }, "MECHANISMS": "Mecanismos", "OPMODES": "OpModes", + "ABOUT": { + "TITLE": "Acerca de", + "OK": "Aceptar", + "VERSION": "Versión", + "NAME": "Nombre", + "AUTHORS": "Autores", + "URL": "URL", + "LICENSE": "Licencia", + "TAB_ATTRIBUTIONS": "Atribuciones de Terceros", + "TAB_DEPENDENCIES": "Dependencias", + "LOADING_ATTRIBUTIONS": "Cargando atribuciones...", + "LOADING_DEPENDENCIES": "Cargando dependencias...", + "ATTRIBUTIONS_NOT_FOUND": "Archivo de atribuciones no encontrado.", + "ERROR_LOADING_ATTRIBUTIONS": "Error al cargar atribuciones.", + "DEPENDENCIES_NOT_AVAILABLE": "Información de dependencias no disponible.", + "ERROR_LOADING_DEPENDENCIES": "Error al cargar dependencias.", + "COPYRIGHT": "© 2025 FIRST. Todos los derechos reservados." + }, "BLOCKLY": { "OF_TYPE": "de tipo", "WITH": "con", diff --git a/src/i18n/locales/he/translation.json b/src/i18n/locales/he/translation.json index dbd63d19..4be9c243 100644 --- a/src/i18n/locales/he/translation.json +++ b/src/i18n/locales/he/translation.json @@ -71,6 +71,24 @@ "NO_FILES_FOUND": "לא נמצאו קבצי {{type}}", "MECHANISMS": "מנגנונים", "OPMODES": "אופמודים", + "ABOUT": { + "TITLE": "אודות", + "OK": "אישור", + "VERSION": "גרסה", + "NAME": "שם", + "AUTHORS": "מחברים", + "URL": "כתובת URL", + "LICENSE": "רישיון", + "TAB_ATTRIBUTIONS": "ייחוסים לצד שלישי", + "TAB_DEPENDENCIES": "תלויות", + "LOADING_ATTRIBUTIONS": "טוען ייחוסים...", + "LOADING_DEPENDENCIES": "טוען תלויות...", + "ATTRIBUTIONS_NOT_FOUND": "קובץ הייחוסים לא נמצא.", + "ERROR_LOADING_ATTRIBUTIONS": "שגיאה בטעינת ייחוסים.", + "DEPENDENCIES_NOT_AVAILABLE": "מידע על תלויות אינו זמין.", + "ERROR_LOADING_DEPENDENCIES": "שגיאה בטעינת תלויות.", + "COPYRIGHT": "© 2025 FIRST. כל הזכויות שמורות." + }, "BLOCKLY": { "OF_TYPE": "מטיפוס", "WITH": "עם", diff --git a/src/reactComponents/AboutModal.tsx b/src/reactComponents/AboutModal.tsx index cb5ecdb7..e73c6d2d 100644 --- a/src/reactComponents/AboutModal.tsx +++ b/src/reactComponents/AboutModal.tsx @@ -21,6 +21,7 @@ import * as React from 'react'; import * as Antd from 'antd'; import { InfoCircleOutlined } from '@ant-design/icons'; +import { useTranslation } from 'react-i18next'; declare const __APP_VERSION__: string; const __APP_NAME__ = "SystemCore Blocks"; @@ -34,8 +35,9 @@ const AboutDialog: React.FC = ({ visible, onClose, }) => { - const [attributions, setAttributions] = React.useState('Loading attributions...'); - const [dependencies, setDependencies] = React.useState('Loading dependencies...'); + const { t } = useTranslation(); + const [attributions, setAttributions] = React.useState(t('ABOUT.LOADING_ATTRIBUTIONS')); + const [dependencies, setDependencies] = React.useState(t('ABOUT.LOADING_DEPENDENCIES')); const attributionsFile = '/attributions.txt'; // Path to the attributions file React.useEffect(() => { @@ -60,21 +62,21 @@ const AboutDialog: React.FC = ({ let text = '' licenses.forEach((licenseData) => { - text += `Name: ${licenseData.name}\n`; - text += `Version: ${licenseData.version}\n`; - text += `Authors: ${licenseData.authors}\n`; - text += `URL: ${licenseData.url}\n`; - text += `License: ${licenseData.license}\n`; + text += `${t('ABOUT.NAME')}: ${licenseData.name}\n`; + text += `${t('ABOUT.VERSION')}: ${licenseData.version}\n`; + text += `${t('ABOUT.AUTHORS')}: ${licenseData.authors}\n`; + text += `${t('ABOUT.URL')}: ${licenseData.url}\n`; + text += `${t('ABOUT.LICENSE')}: ${licenseData.license}\n`; text += `\n`; }); setAttributions(text); } else { - setAttributions('Attributions file not found.'); + setAttributions(t('ABOUT.ATTRIBUTIONS_NOT_FOUND')); } } catch (error) { console.error('Error loading attributions:', error); - setAttributions('Error loading attributions.'); + setAttributions(t('ABOUT.ERROR_LOADING_ATTRIBUTIONS')); } }; @@ -96,11 +98,11 @@ const AboutDialog: React.FC = ({ }); setDependencies(depText); } else { - setDependencies('Dependencies information not available.'); + setDependencies(t('ABOUT.DEPENDENCIES_NOT_AVAILABLE')); } } catch (error) { console.error('Error loading dependencies:', error); - setDependencies('Error loading dependencies.'); + setDependencies(t('ABOUT.ERROR_LOADING_DEPENDENCIES')); } }; @@ -109,11 +111,11 @@ const AboutDialog: React.FC = ({ title={ - About + {t('ABOUT.TITLE')} } open={visible} - footer={[OK]} + footer={[{t('ABOUT.OK')}]} onCancel={onClose} onOk={onClose} width={600} @@ -122,7 +124,7 @@ const AboutDialog: React.FC = ({
{__APP_NAME__} - Version: {__APP_VERSION__} + {t('ABOUT.VERSION')}: {__APP_VERSION__}
@@ -131,7 +133,7 @@ const AboutDialog: React.FC = ({ items={[ { key: 'attributions', - label: 'Third-Party Attributions', + label: t('ABOUT.TAB_ATTRIBUTIONS'), children: ( = ({ }, { key: 'dependencies', - label: 'Dependencies', + label: t('ABOUT.TAB_DEPENDENCIES'), children: ( = ({
- © 2025 FIRST. All rights reserved. + {t('ABOUT.COPYRIGHT')}