Skip to content

Commit 4b088e3

Browse files
authored
Internationalize strings for Menu.tsx. (#346)
1 parent b9d4802 commit 4b088e3

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

src/i18n/locales/en/translation.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
"project_rename": "Rename Project",
1010
"project_copy": "Copy Project",
1111
"fail_list_projects": "Failed to load the list of projects.",
12+
"NO_PROJECT_SELECTED": "No project selected.",
13+
"DEPLOY_FAILED": "Failed to deploy project.",
14+
"DOWNLOAD_FAILED": "Failed to download project.",
15+
"UPLOAD_FILE_NOT_BLOCKS": "{{filename}} is not a blocks file.",
16+
"UPLOAD_FAILED": "Failed to upload project.",
1217
"MECHANISM": "Mechanism",
1318
"OPMODE": "OpMode",
1419
"class_rule_description": "No spaces are allowed in the name. Each word in the name should start with a capital letter.",

src/i18n/locales/es/translation.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"project_rename": "Renombrar Proyecto",
1111
"project_copy": "Copiar Proyecto",
1212
"fail_list_projects": "Error al cargar la lista de proyectos.",
13+
"NO_PROJECT_SELECTED": "No hay ningún proyecto seleccionado.",
14+
"DEPLOY_FAILED": "Error al implementar el proyecto.",
15+
"DOWNLOAD_FAILED": "Error al descargar el proyecto.",
16+
"UPLOAD_FILE_NOT_BLOCKS": "{{filename}} no es un archivo de bloques.",
17+
"UPLOAD_FAILED": "Error al cargar el proyecto.",
1318
"MECHANISM": "Mecanismo",
1419
"OPMODE": "OpMode",
1520
"class_rule_description": "No se permiten espacios en el nombre. Cada palabra en el nombre debe comenzar con una letra mayúscula.",

src/i18n/locales/he/translation.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
"project_rename": "שנה שם פרויקט",
1010
"project_copy": "העתק פרויקט",
1111
"fail_list_projects": "נכשל בטעינת רשימת הפרויקטים.",
12+
"NO_PROJECT_SELECTED": "לא נבחר פרויקט.",
13+
"DEPLOY_FAILED": "פריסת הפרויקט נכשלה.",
14+
"DOWNLOAD_FAILED": "הורדת הפרויקט נכשלה.",
15+
"UPLOAD_FILE_NOT_BLOCKS": "{{filename}} אינו קובץ בלוקים.",
16+
"UPLOAD_FAILED": "העלאת הפרויקט נכשלה.",
1217
"MECHANISM": "מנגנון",
1318
"OPMODE": "אופמוד",
1419
"class_rule_description": "אסור שיהיו רווחים בשם. כל מילה בשם צריכה להתחיל באות גדולה.",

src/reactComponents/Menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ export function Component(props: MenuProps): React.JSX.Element {
368368
URL.revokeObjectURL(blobUrl);
369369
} catch (error) {
370370
console.error('Failed to download project:', error);
371-
props.setAlertErrorMessage(t('DOWNLOAD_FAILED') || 'Failed to download project');
371+
props.setAlertErrorMessage(t('DOWNLOAD_FAILED'));
372372
}
373373
}
374374

@@ -385,7 +385,7 @@ export function Component(props: MenuProps): React.JSX.Element {
385385
const isBlocks = file.name.endsWith(storageNames.UPLOAD_DOWNLOAD_FILE_EXTENSION)
386386
if (!isBlocks) {
387387
// TODO: i18n
388-
props.setAlertErrorMessage(file.name + ' is not a blocks file');
388+
props.setAlertErrorMessage(t('UPLOAD_FILE_NOT_BLOCKS', { filename: file.name }));
389389
return false;
390390
}
391391
return isBlocks || Antd.Upload.LIST_IGNORE;

0 commit comments

Comments
 (0)