diff --git a/src/blocks/mrc_event_handler.ts b/src/blocks/mrc_event_handler.ts index e97d2dd9..03f0c01a 100644 --- a/src/blocks/mrc_event_handler.ts +++ b/src/blocks/mrc_event_handler.ts @@ -215,7 +215,7 @@ const EVENT_HANDLER = { } } if (!foundRobotEvent) { - warnings.push('This block is an event handler for an event that no longer exists.'); + warnings.push(Blockly.Msg.EVENT_HANDLER_ROBOT_EVENT_NOT_FOUND); } } @@ -266,7 +266,7 @@ const EVENT_HANDLER = { } } if (!foundMechanismEvent) { - warnings.push('This block is an event handler for an event that no longer exists.'); + warnings.push(Blockly.Msg.EVENT_HANDLER_MECHANISM_EVENT_NOT_FOUND); } // Since we found the mechanism, we can break out of the loop. @@ -274,7 +274,7 @@ const EVENT_HANDLER = { } } if (!foundMechanism) { - warnings.push('This block is an event handler for an event in a mechanism that no longer exists.'); + warnings.push(Blockly.Msg.EVENT_HANDLER_MECHANISM_NOT_FOUND); } } } diff --git a/src/blocks/tokens.ts b/src/blocks/tokens.ts index 8ce13798..58ef15a6 100644 --- a/src/blocks/tokens.ts +++ b/src/blocks/tokens.ts @@ -37,6 +37,12 @@ export function customTokens(t: (key: string) => string): typeof Blockly.Msg { t('BLOCKLY.PARAMETERS_CAN_ONLY_GO_IN_THEIR_METHODS_BLOCK'), EVENT_HANDLER_ALREADY_ON_WORKSPACE: t('BLOCKLY.EVENT_HANDLER_ALREADY_ON_WORKSPACE'), + EVENT_HANDLER_ROBOT_EVENT_NOT_FOUND: + t('BLOCKLY.EVENT_HANDLER_ROBOT_EVENT_NOT_FOUND'), + EVENT_HANDLER_MECHANISM_EVENT_NOT_FOUND: + t('BLOCKLY.EVENT_HANDLER_MECHANISM_EVENT_NOT_FOUND'), + EVENT_HANDLER_MECHANISM_NOT_FOUND: + t('BLOCKLY.EVENT_HANDLER_MECHANISM_NOT_FOUND'), MECHANISMS: t('MECHANISMS'), OPMODES: t('OPMODES'), COMPONENTS: t('BLOCKLY.COMPONENTS'), @@ -103,4 +109,4 @@ export function customTokens(t: (key: string) => string): typeof Blockly.Msg { MRC_CATEGORY_TEST: t('BLOCKLY.CATEGORY.TEST'), MRC_PRINT: t('BLOCKLY.PRINT'), } -}; \ No newline at end of file +}; \ No newline at end of file diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index 7811dfb8..2cea6220 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -78,6 +78,9 @@ "PARAMETER": "parameter", "PARAMETERS_CAN_ONLY_GO_IN_THEIR_METHODS_BLOCK": "Parameters can only go in their method's block", "EVENT_HANDLER_ALREADY_ON_WORKSPACE": "This event handler is already on the workspace.", + "EVENT_HANDLER_ROBOT_EVENT_NOT_FOUND": "This block is an event handler for an event that no longer exists.", + "EVENT_HANDLER_MECHANISM_EVENT_NOT_FOUND": "This block is an event handler for an event that no longer exists.", + "EVENT_HANDLER_MECHANISM_NOT_FOUND": "This block is an event handler for an event in a mechanism that no longer exists.", "COMPONENTS": "Components", "PRIVATE_COMPONENTS": "Private Components", "EVENTS": "Events", diff --git a/src/i18n/locales/es/translation.json b/src/i18n/locales/es/translation.json index ae2464dd..ebb5764c 100644 --- a/src/i18n/locales/es/translation.json +++ b/src/i18n/locales/es/translation.json @@ -79,6 +79,9 @@ "PARAMETER": "parámetro", "PARAMETERS_CAN_ONLY_GO_IN_THEIR_METHODS_BLOCK": "Los parámetros solo pueden ir en el bloque de su método", "EVENT_HANDLER_ALREADY_ON_WORKSPACE": "Este controlador de eventos ya está en el área de trabajo.", + "EVENT_HANDLER_ROBOT_EVENT_NOT_FOUND": "Este bloque es un controlador de eventos para un evento que ya no existe.", + "EVENT_HANDLER_MECHANISM_EVENT_NOT_FOUND": "Este bloque es un controlador de eventos para un evento que ya no existe.", + "EVENT_HANDLER_MECHANISM_NOT_FOUND": "Este bloque es un controlador de eventos para un evento en un mecanismo que ya no existe.", "COMPONENTS": "Componentes", "PRIVATE_COMPONENTS": "Componentes Privados", "EVENTS": "Eventos", diff --git a/src/i18n/locales/he/translation.json b/src/i18n/locales/he/translation.json index 866a3cae..dbd63d19 100644 --- a/src/i18n/locales/he/translation.json +++ b/src/i18n/locales/he/translation.json @@ -78,6 +78,9 @@ "PARAMETER": "פרמטר", "PARAMETERS_CAN_ONLY_GO_IN_THEIR_METHODS_BLOCK": "פרמטרים יכולים להופיע רק בתוך הבלוק של המתודה שלהם.", "EVENT_HANDLER_ALREADY_ON_WORKSPACE": "מנהל האירועים הזה כבר נמצא בסביבת העבודה.", + "EVENT_HANDLER_ROBOT_EVENT_NOT_FOUND": "הבלוק הזה הוא מנהל אירועים לאירוע שכבר לא קיים.", + "EVENT_HANDLER_MECHANISM_EVENT_NOT_FOUND": "הבלוק הזה הוא מנהל אירועים לאירוע שכבר לא קיים.", + "EVENT_HANDLER_MECHANISM_NOT_FOUND": "הבלוק הזה הוא מנהל אירועים לאירוע במנגנון שכבר לא קיים.", "COMPONENTS": "רכיבים", "PRIVATE_COMPONENTS": "רכיבים פרטיים", "EVENTS": "אירועים",