From 0cffc1fbe2c8a9ae6364af5e41a299d77bc1a3e6 Mon Sep 17 00:00:00 2001 From: Liz Looney Date: Tue, 2 Dec 2025 21:56:06 -0800 Subject: [PATCH] Internationalize strings for Menu.tsx. --- src/i18n/locales/en/translation.json | 5 +++++ src/i18n/locales/es/translation.json | 5 +++++ src/i18n/locales/he/translation.json | 5 +++++ src/reactComponents/Menu.tsx | 4 ++-- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index 155ed722..81b951df 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -9,6 +9,11 @@ "project_rename": "Rename Project", "project_copy": "Copy Project", "fail_list_projects": "Failed to load the list of projects.", + "NO_PROJECT_SELECTED": "No project selected.", + "DEPLOY_FAILED": "Failed to deploy project.", + "DOWNLOAD_FAILED": "Failed to download project.", + "UPLOAD_FILE_NOT_BLOCKS": "{{filename}} is not a blocks file.", + "UPLOAD_FAILED": "Failed to upload project.", "MECHANISM": "Mechanism", "OPMODE": "OpMode", "class_rule_description": "No spaces are allowed in the name. Each word in the name should start with a capital letter.", diff --git a/src/i18n/locales/es/translation.json b/src/i18n/locales/es/translation.json index 6469f9b7..e7c41b45 100644 --- a/src/i18n/locales/es/translation.json +++ b/src/i18n/locales/es/translation.json @@ -10,6 +10,11 @@ "project_rename": "Renombrar Proyecto", "project_copy": "Copiar Proyecto", "fail_list_projects": "Error al cargar la lista de proyectos.", + "NO_PROJECT_SELECTED": "No hay ningún proyecto seleccionado.", + "DEPLOY_FAILED": "Error al implementar el proyecto.", + "DOWNLOAD_FAILED": "Error al descargar el proyecto.", + "UPLOAD_FILE_NOT_BLOCKS": "{{filename}} no es un archivo de bloques.", + "UPLOAD_FAILED": "Error al cargar el proyecto.", "MECHANISM": "Mecanismo", "OPMODE": "OpMode", "class_rule_description": "No se permiten espacios en el nombre. Cada palabra en el nombre debe comenzar con una letra mayúscula.", diff --git a/src/i18n/locales/he/translation.json b/src/i18n/locales/he/translation.json index 2f81359e..540c2969 100644 --- a/src/i18n/locales/he/translation.json +++ b/src/i18n/locales/he/translation.json @@ -9,6 +9,11 @@ "project_rename": "שנה שם פרויקט", "project_copy": "העתק פרויקט", "fail_list_projects": "נכשל בטעינת רשימת הפרויקטים.", + "NO_PROJECT_SELECTED": "לא נבחר פרויקט.", + "DEPLOY_FAILED": "פריסת הפרויקט נכשלה.", + "DOWNLOAD_FAILED": "הורדת הפרויקט נכשלה.", + "UPLOAD_FILE_NOT_BLOCKS": "{{filename}} אינו קובץ בלוקים.", + "UPLOAD_FAILED": "העלאת הפרויקט נכשלה.", "MECHANISM": "מנגנון", "OPMODE": "אופמוד", "class_rule_description": "אסור שיהיו רווחים בשם. כל מילה בשם צריכה להתחיל באות גדולה.", diff --git a/src/reactComponents/Menu.tsx b/src/reactComponents/Menu.tsx index 9d65a71a..8157e33e 100644 --- a/src/reactComponents/Menu.tsx +++ b/src/reactComponents/Menu.tsx @@ -368,7 +368,7 @@ export function Component(props: MenuProps): React.JSX.Element { URL.revokeObjectURL(blobUrl); } catch (error) { console.error('Failed to download project:', error); - props.setAlertErrorMessage(t('DOWNLOAD_FAILED') || 'Failed to download project'); + props.setAlertErrorMessage(t('DOWNLOAD_FAILED')); } } @@ -385,7 +385,7 @@ export function Component(props: MenuProps): React.JSX.Element { const isBlocks = file.name.endsWith(storageNames.UPLOAD_DOWNLOAD_FILE_EXTENSION) if (!isBlocks) { // TODO: i18n - props.setAlertErrorMessage(file.name + ' is not a blocks file'); + props.setAlertErrorMessage(t('UPLOAD_FILE_NOT_BLOCKS', { filename: file.name })); return false; } return isBlocks || Antd.Upload.LIST_IGNORE;