Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/blocks/mrc_event_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -266,15 +266,15 @@ 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.
break;
}
}
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);
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion src/blocks/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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'),
}
};
};
3 changes: 3 additions & 0 deletions src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/he/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "אירועים",
Expand Down