Skip to content

Commit 92b462f

Browse files
authored
Merge branch 'main' into blocks_i18n
2 parents 578b646 + e31862e commit 92b462f

File tree

12 files changed

+957
-954
lines changed

12 files changed

+957
-954
lines changed

oss-attribution/attribution.txt

Lines changed: 179 additions & 276 deletions
Large diffs are not rendered by default.

oss-attribution/licenseInfos.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

package-lock.json

Lines changed: 671 additions & 651 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
"i18next": "^25.3.2",
1919
"i18next-http-backend": "^3.0.2",
2020
"jszip": "^3.10.1",
21-
"lucide-react": "^0.525.0",
21+
"lucide-react": "^0.544.0",
2222
"re-resizable": "^6.11.2",
2323
"react": "^19.1.0",
2424
"react-dom": "^19.1.0",
25-
"react-i18next": "^15.6.0",
25+
"react-i18next": "^16.0.0",
2626
"react-syntax-highlighter": "^15.6.1",
2727
"semver": "^7.7.2",
2828
"typescript": "^5.9.2",
@@ -60,7 +60,7 @@
6060
"@types/node": "^24.0.15",
6161
"@types/react-syntax-highlighter": "^15.5.13",
6262
"@types/semver": "^7.7.0",
63-
"@vitejs/plugin-react": "^4.7.0",
63+
"@vitejs/plugin-react": "^5.0.4",
6464
"autoprefixer": "^10.4.21",
6565
"playwright": "^1.54.1",
6666
"postcss": "^8.5.6",

src/blocks/tokens.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ export function customTokens(t: (key: string) => string): typeof Blockly.Msg {
120120
MRC_CATEGORY_ADD_COMPONENT: t('BLOCKLY.CATEGORY.ADD_COMPONENT'),
121121
MRC_CATEGORY_TEST: t('BLOCKLY.CATEGORY.TEST'),
122122
MRC_PRINT: t('BLOCKLY.PRINT'),
123+
CUSTOM_EVENTS_LABEL: t('BLOCKLY.CUSTOM_EVENTS_LABEL'),
124+
CUSTOM_METHODS_LABEL: t('BLOCKLY.CUSTOM_METHODS_LABEL'),
125+
MORE_ROBOT_METHODS_LABEL: t('BLOCKLY.MORE_ROBOT_METHODS_LABEL'),
126+
MORE_MECHANISM_METHODS_LABEL: t('BLOCKLY.MORE_MECHANISM_METHODS_LABEL'),
127+
MORE_OPMODE_METHODS_LABEL: t('BLOCKLY.MORE_OPMODE_METHODS_LABEL'),
128+
COMMENT_DEFAULT_TEXT: t('BLOCKLY.COMMENT_DEFAULT_TEXT'),
123129
}
124130
};
125131

src/i18n/locales/en/translation.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,24 @@
7171
"NO_FILES_FOUND": "No {{type}} files found",
7272
"MECHANISMS": "Mechanisms",
7373
"OPMODES": "OpModes",
74+
"ABOUT": {
75+
"TITLE": "About",
76+
"OK": "OK",
77+
"VERSION": "Version",
78+
"NAME": "Name",
79+
"AUTHORS": "Authors",
80+
"URL": "URL",
81+
"LICENSE": "License",
82+
"TAB_ATTRIBUTIONS": "Third-Party Attributions",
83+
"TAB_DEPENDENCIES": "Dependencies",
84+
"LOADING_ATTRIBUTIONS": "Loading attributions...",
85+
"LOADING_DEPENDENCIES": "Loading dependencies...",
86+
"ATTRIBUTIONS_NOT_FOUND": "Attributions file not found.",
87+
"ERROR_LOADING_ATTRIBUTIONS": "Error loading attributions.",
88+
"DEPENDENCIES_NOT_AVAILABLE": "Dependencies information not available.",
89+
"ERROR_LOADING_DEPENDENCIES": "Error loading dependencies.",
90+
"COPYRIGHT": "© 2025 FIRST. All rights reserved."
91+
},
7492
"BLOCKLY":{
7593
"OF_TYPE": "of type",
7694
"WITH": "with",
@@ -99,6 +117,12 @@
99117
"GET": "get",
100118
"SET": "set",
101119
"TO": "to",
120+
"CUSTOM_EVENTS_LABEL": "Custom Events",
121+
"CUSTOM_METHODS_LABEL": "Custom Methods",
122+
"MORE_ROBOT_METHODS_LABEL": "More Robot Methods",
123+
"MORE_MECHANISM_METHODS_LABEL": "More Mechanism Methods",
124+
"MORE_OPMODE_METHODS_LABEL": "More OpMode Methods",
125+
"COMMENT_DEFAULT_TEXT": "Enter your comment here!",
102126
"TOOLTIP":{
103127
"EVALUATE_BUT_IGNORE_RESULT": "Executes the connected block and ignores the result. Allows you to call a function and ignore the return value.",
104128
"NONE": "Returns None.",

src/i18n/locales/es/translation.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,24 @@
7272
},
7373
"MECHANISMS": "Mecanismos",
7474
"OPMODES": "OpModes",
75+
"ABOUT": {
76+
"TITLE": "Acerca de",
77+
"OK": "Aceptar",
78+
"VERSION": "Versión",
79+
"NAME": "Nombre",
80+
"AUTHORS": "Autores",
81+
"URL": "URL",
82+
"LICENSE": "Licencia",
83+
"TAB_ATTRIBUTIONS": "Atribuciones de Terceros",
84+
"TAB_DEPENDENCIES": "Dependencias",
85+
"LOADING_ATTRIBUTIONS": "Cargando atribuciones...",
86+
"LOADING_DEPENDENCIES": "Cargando dependencias...",
87+
"ATTRIBUTIONS_NOT_FOUND": "Archivo de atribuciones no encontrado.",
88+
"ERROR_LOADING_ATTRIBUTIONS": "Error al cargar atribuciones.",
89+
"DEPENDENCIES_NOT_AVAILABLE": "Información de dependencias no disponible.",
90+
"ERROR_LOADING_DEPENDENCIES": "Error al cargar dependencias.",
91+
"COPYRIGHT": "© 2025 FIRST. Todos los derechos reservados."
92+
},
7593
"BLOCKLY": {
7694
"OF_TYPE": "de tipo",
7795
"WITH": "con",
@@ -100,6 +118,12 @@
100118
"GET": "obtener",
101119
"SET": "establecer",
102120
"TO": "a",
121+
"CUSTOM_EVENTS_LABEL": "Eventos Personalizados",
122+
"CUSTOM_METHODS_LABEL": "Métodos Personalizados",
123+
"MORE_ROBOT_METHODS_LABEL": "Más Métodos del Robot",
124+
"MORE_MECHANISM_METHODS_LABEL": "Más Métodos del Mecanismo",
125+
"MORE_OPMODE_METHODS_LABEL": "Más Métodos del OpMode",
126+
"COMMENT_DEFAULT_TEXT": "¡Ingresa tu comentario aquí!",
103127
"TOOLTIP": {
104128
"EVALUATE_BUT_IGNORE_RESULT": "Ejecuta el bloque conectado e ignora el resultado. Te permite llamar una función e ignorar el valor de retorno.",
105129
"NONE": "No devuelve ninguno.",

src/i18n/locales/he/translation.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,24 @@
7171
"NO_FILES_FOUND": "לא נמצאו קבצי {{type}}",
7272
"MECHANISMS": "מנגנונים",
7373
"OPMODES": "אופמודים",
74+
"ABOUT": {
75+
"TITLE": "אודות",
76+
"OK": "אישור",
77+
"VERSION": "גרסה",
78+
"NAME": "שם",
79+
"AUTHORS": "מחברים",
80+
"URL": "כתובת URL",
81+
"LICENSE": "רישיון",
82+
"TAB_ATTRIBUTIONS": "ייחוסים לצד שלישי",
83+
"TAB_DEPENDENCIES": "תלויות",
84+
"LOADING_ATTRIBUTIONS": "טוען ייחוסים...",
85+
"LOADING_DEPENDENCIES": "טוען תלויות...",
86+
"ATTRIBUTIONS_NOT_FOUND": "קובץ הייחוסים לא נמצא.",
87+
"ERROR_LOADING_ATTRIBUTIONS": "שגיאה בטעינת ייחוסים.",
88+
"DEPENDENCIES_NOT_AVAILABLE": "מידע על תלויות אינו זמין.",
89+
"ERROR_LOADING_DEPENDENCIES": "שגיאה בטעינת תלויות.",
90+
"COPYRIGHT": "© 2025 FIRST. כל הזכויות שמורות."
91+
},
7492
"BLOCKLY": {
7593
"OF_TYPE": "מטיפוס",
7694
"WITH": "עם",
@@ -99,6 +117,12 @@
99117
"GET": "קבל",
100118
"SET": "הגדר",
101119
"TO": "ל",
120+
"CUSTOM_EVENTS_LABEL": "אירועים מותאמים אישית",
121+
"CUSTOM_METHODS_LABEL": "מתודות מותאמות אישית",
122+
"MORE_ROBOT_METHODS_LABEL": "מתודות נוספות לרובוט",
123+
"MORE_MECHANISM_METHODS_LABEL": "מתודות נוספות למנגנון",
124+
"MORE_OPMODE_METHODS_LABEL": "מתודות נוספות לאופמוד",
125+
"COMMENT_DEFAULT_TEXT": "הזן את ההערה שלך כאן!",
102126
"TOOLTIP": {
103127
"EVALUATE_BUT_IGNORE_RESULT": "מבצע את הבלוק המחובר ומתעלם מהתוצאה. מאפשר לקרוא לפונקציה מבלי להשתמש בערך שהיא מחזירה.",
104128
"NONE": "מחזיר כלום.",

src/reactComponents/AboutModal.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import * as React from 'react';
2222
import * as Antd from 'antd';
2323
import { InfoCircleOutlined } from '@ant-design/icons';
24+
import { useTranslation } from 'react-i18next';
2425

2526
declare const __APP_VERSION__: string;
2627
const __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>

src/toolbox/event_category.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class EventsCategory {
6565
contents.push(
6666
{
6767
kind: 'label',
68-
text: 'Custom Events',
68+
text: Blockly.Msg['CUSTOM_EVENTS_LABEL'],
6969
},
7070
createCustomEventBlock(storageNames.makeUniqueName('my_event', eventNames))
7171
);

0 commit comments

Comments
 (0)