diff --git a/src/blocks/mrc_call_python_function.ts b/src/blocks/mrc_call_python_function.ts index 359703d8..8aa53fbe 100644 --- a/src/blocks/mrc_call_python_function.ts +++ b/src/blocks/mrc_call_python_function.ts @@ -85,7 +85,6 @@ interface CallPythonFunctionMixin extends CallPythonFunctionMixinType { mrcComponentClassName: string, mrcOriginalComponentName: string, mrcMechanismClassName: string, - mrcComponentNames: string[], mrcMapComponentNameToId: {[componentName: string]: string}, } type CallPythonFunctionMixinType = typeof CALL_PYTHON_FUNCTION; @@ -167,65 +166,88 @@ const CALL_PYTHON_FUNCTION = { switch (this.mrcFunctionKind) { case FunctionKind.BUILT_IN: { const functionName = this.getFieldValue(FIELD_FUNCTION_NAME); - tooltip = 'Calls the builtin function ' + functionName + '.'; + tooltip = Blockly.Msg.CALL_BUILTIN_FUNCTION_TOOLTIP; + tooltip = tooltip.replace('{{functionName}}', functionName); break; } case FunctionKind.MODULE: { const moduleName = this.getFieldValue(FIELD_MODULE_OR_CLASS_NAME); const functionName = this.getFieldValue(FIELD_FUNCTION_NAME); - tooltip = 'Calls the module function ' + moduleName + '.' + functionName + '.'; + tooltip = Blockly.Msg.CALL_MODULE_FUNCTION_TOOLTIP; + tooltip = tooltip + .replace('{{moduleName}}', moduleName) + .replace('{{functionName}}', functionName); break; } case FunctionKind.STATIC: { const className = this.getFieldValue(FIELD_MODULE_OR_CLASS_NAME); const functionName = this.getFieldValue(FIELD_FUNCTION_NAME); - tooltip = 'Calls the static method ' + className + '.' + functionName + '.'; + tooltip = Blockly.Msg.CALL_STATIC_METHOD_TOOLTIP; + tooltip = tooltip + .replace('{{className}}', className) + .replace('{{functionName}}', functionName); break; } case FunctionKind.CONSTRUCTOR: { const className = this.getFieldValue(FIELD_MODULE_OR_CLASS_NAME); - tooltip = 'Constructs an instance of the class ' + className + '.'; + tooltip = Blockly.Msg.CALL_CONSTRUCTOR_TOOLTIP; + tooltip = tooltip.replace('{{className}}', className); break; } case FunctionKind.INSTANCE: { const className = this.getFieldValue(FIELD_MODULE_OR_CLASS_NAME); const functionName = this.getFieldValue(FIELD_FUNCTION_NAME); - tooltip = 'Calls the instance method ' + className + '.' + functionName + '.'; + tooltip = Blockly.Msg.CALL_INSTANCE_METHOD_TOOLTIP; + tooltip = tooltip + .replace('{{className}}', className) + .replace('{{functionName}}', functionName); break; } case FunctionKind.INSTANCE_WITHIN: { const functionName = this.getFieldValue(FIELD_FUNCTION_NAME); - tooltip = 'Calls the instance method ' + functionName + '.'; + tooltip = Blockly.Msg.CALL_INSTANCE_METHOD_WITHIN_TOOLTIP; + tooltip = tooltip.replace('{{functionName}}', functionName); break; } case FunctionKind.EVENT: { const eventName = this.getFieldValue(FIELD_EVENT_NAME); - tooltip = 'Fires the event ' + eventName + '.'; + tooltip = Blockly.Msg.CALL_INSTANCE_METHOD_WITHIN_TOOLTIP; + tooltip = tooltip.replace('{{eventName}}', eventName); break; } case FunctionKind.INSTANCE_COMPONENT: { const className = this.mrcComponentClassName; const functionName = this.getFieldValue(FIELD_FUNCTION_NAME); if (this.mrcMechanismId) { - tooltip = 'Calls the instance method ' + className + '.' + functionName + - ' on the component named ' + this.getFieldValue(FIELD_COMPONENT_NAME) + - ' in the mechanism named ' + this.getFieldValue(FIELD_MECHANISM_NAME) + '.'; + tooltip = Blockly.Msg.CALL_MECHANISM_COMPONENT_INSTANCE_METHOD; + tooltip = tooltip + .replace('{{className}}', className) + .replace('{{functionName}}', functionName) + .replace('{{componentName}}', this.getFieldValue(FIELD_COMPONENT_NAME)) + .replace('{{mechanismName}}', this.getFieldValue(FIELD_MECHANISM_NAME)); } else { - tooltip = 'Calls the instance method ' + className + '.' + functionName + - ' on the component named ' + this.getFieldValue(FIELD_COMPONENT_NAME) + '.'; + tooltip = Blockly.Msg.CALL_COMPONENT_INSTANCE_METHOD; + tooltip = tooltip + .replace('{{className}}', className) + .replace('{{functionName}}', functionName) + .replace('{{componentName}}', this.getFieldValue(FIELD_COMPONENT_NAME)); } break; } case FunctionKind.INSTANCE_ROBOT: { const functionName = this.getFieldValue(FIELD_FUNCTION_NAME); - tooltip = 'Calls the robot method ' + functionName + '.'; + tooltip = Blockly.Msg.CALL_INSTANCE_METHOD_WITHIN_TOOLTIP; + tooltip = tooltip.replace('{{functionName}}', functionName); break; } case FunctionKind.INSTANCE_MECHANISM: { const className = this.mrcMechanismClassName; const functionName = this.getFieldValue(FIELD_FUNCTION_NAME); - tooltip = 'Calls the instance method ' + className + '.' + functionName + - ' on the mechanism named ' + this.getFieldValue(FIELD_MECHANISM_NAME) + '.'; + tooltip = Blockly.Msg.CALL_MECHANISM_INSTANCE_METHOD; + tooltip = tooltip + .replace('{{className}}', className) + .replace('{{functionName}}', functionName) + .replace('{{mechanismName}}', this.getFieldValue(FIELD_MECHANISM_NAME)); break; } default: @@ -318,8 +340,7 @@ const CALL_PYTHON_FUNCTION = { this.mrcMechanismId = extraState.mechanismId ? extraState.mechanismId : ''; this.mrcComponentClassName = extraState.componentClassName ? extraState.componentClassName : ''; this.mrcMechanismClassName = extraState.mechanismClassName ? extraState.mechanismClassName : ''; - // Initialize mrcComponentNames and mrcMapComponentNameToId here. They will be filled during mrcValidate. - this.mrcComponentNames = []; + // Initialize mrcMapComponentNameToId here. It will be filled during mrcValidate. this.mrcMapComponentNameToId = {}; this.updateBlock_(); }, @@ -349,31 +370,31 @@ const CALL_PYTHON_FUNCTION = { switch (this.mrcFunctionKind) { case FunctionKind.BUILT_IN: this.appendDummyInput(INPUT_TITLE) - .appendField('call') + .appendField(Blockly.Msg.CALL) .appendField(createFieldNonEditableText(''), FIELD_FUNCTION_NAME); break; case FunctionKind.MODULE: this.appendDummyInput(INPUT_TITLE) - .appendField('call') + .appendField(Blockly.Msg.CALL) .appendField(createFieldNonEditableText(''), FIELD_MODULE_OR_CLASS_NAME) .appendField('.') .appendField(createFieldNonEditableText(''), FIELD_FUNCTION_NAME); break; case FunctionKind.STATIC: this.appendDummyInput(INPUT_TITLE) - .appendField('call') + .appendField(Blockly.Msg.CALL) .appendField(createFieldNonEditableText(''), FIELD_MODULE_OR_CLASS_NAME) .appendField('.') .appendField(createFieldNonEditableText(''), FIELD_FUNCTION_NAME); break; case FunctionKind.CONSTRUCTOR: this.appendDummyInput(INPUT_TITLE) - .appendField('create') + .appendField(Blockly.Msg.CREATE) .appendField(createFieldNonEditableText(''), FIELD_MODULE_OR_CLASS_NAME); break; case FunctionKind.INSTANCE: this.appendDummyInput(INPUT_TITLE) - .appendField('call') + .appendField(Blockly.Msg.CALL) .appendField(createFieldNonEditableText(''), FIELD_MODULE_OR_CLASS_NAME) .appendField('.') .appendField(createFieldNonEditableText(''), FIELD_FUNCTION_NAME); @@ -382,7 +403,7 @@ const CALL_PYTHON_FUNCTION = { const input = this.getInput(INPUT_TITLE); if (!input) { this.appendDummyInput(INPUT_TITLE) - .appendField('call') + .appendField(Blockly.Msg.CALL) .appendField(createFieldNonEditableText(''), FIELD_FUNCTION_NAME); } break; @@ -391,14 +412,14 @@ const CALL_PYTHON_FUNCTION = { const input = this.getInput(INPUT_TITLE); if (!input) { this.appendDummyInput(INPUT_TITLE) - .appendField('fire') + .appendField(Blockly.Msg.FIRE) .appendField(createFieldNonEditableText(''), FIELD_EVENT_NAME); } break; } case FunctionKind.INSTANCE_COMPONENT: { const titleInput = this.appendDummyInput(INPUT_TITLE) - .appendField('call'); + .appendField(Blockly.Msg.CALL); if (this.mrcMechanismId) { titleInput .appendField(createFieldNonEditableText(''), FIELD_MECHANISM_NAME) @@ -414,15 +435,15 @@ const CALL_PYTHON_FUNCTION = { } case FunctionKind.INSTANCE_ROBOT: { this.appendDummyInput(INPUT_TITLE) - .appendField('call') - .appendField(createFieldNonEditableText('robot')) + .appendField(Blockly.Msg.CALL) + .appendField(createFieldNonEditableText(Blockly.Msg.ROBOT)) .appendField('.') .appendField(createFieldNonEditableText(''), FIELD_FUNCTION_NAME); break; } case FunctionKind.INSTANCE_MECHANISM: { this.appendDummyInput(INPUT_TITLE) - .appendField('call') + .appendField(Blockly.Msg.CALL) .appendField(createFieldNonEditableText(''), FIELD_MECHANISM_NAME) .appendField('.') .appendField(createFieldNonEditableText(''), FIELD_FUNCTION_NAME); @@ -505,7 +526,7 @@ const CALL_PYTHON_FUNCTION = { methodOrEvent: storageModuleContent.Method | storageModuleContent.Event ): void { // mutateMethodCaller is called when the method or event definition block in the same module is modified. - if (this.mrcFunctionKind == FunctionKind.EVENT) { + if (this.mrcFunctionKind === FunctionKind.EVENT) { const event = methodOrEvent as storageModuleContent.Event; this.mrcArgs = []; event.args.forEach((arg) => { @@ -514,7 +535,7 @@ const CALL_PYTHON_FUNCTION = { type: arg.type, }); }); - } else if (this.mrcFunctionKind == FunctionKind.INSTANCE_WITHIN) { + } else if (this.mrcFunctionKind === FunctionKind.INSTANCE_WITHIN) { const method = methodOrEvent as storageModuleContent.Method; this.mrcReturnType = method.returnType; this.mrcArgs = []; @@ -591,12 +612,14 @@ const CALL_PYTHON_FUNCTION = { // If the component belongs to a mechanism, also check whether the mechanism // still exists and whether it has been changed. if (this.mrcFunctionKind === FunctionKind.INSTANCE_COMPONENT) { + const componentNames: string[] = []; + this.mrcMapComponentNameToId = {} this.getComponents().forEach(component => { - this.mrcComponentNames.push(component.name); + componentNames.push(component.name); this.mrcMapComponentNameToId[component.name] = component.componentId; }); let foundComponent = false; - for (const componentName of this.mrcComponentNames) { + for (const componentName of componentNames) { const componentId = this.mrcMapComponentNameToId[componentName]; if (componentId === this.mrcComponentId) { foundComponent = true; @@ -615,12 +638,12 @@ const CALL_PYTHON_FUNCTION = { break; } } - if (indexOfComponentNameField == -1) { + if (indexOfComponentNameField === -1) { throw new Error('Could not find the component name field'); } titleInput.removeField(FIELD_COMPONENT_NAME); titleInput.insertFieldAt(indexOfComponentNameField, - createFieldDropdown(this.mrcComponentNames), FIELD_COMPONENT_NAME); + createFieldDropdown(componentNames), FIELD_COMPONENT_NAME); // TODO(lizlooney): If the current module is the robot or a mechanism, we need to update the // items in the dropdown if the user adds or removes a component. @@ -631,7 +654,39 @@ const CALL_PYTHON_FUNCTION = { } } if (!foundComponent) { - warnings.push('This block calls a method on a component that no longer exists.'); + if (this.mrcMechanismId) { + // Check whether the the component still exists, but is a private component in the mechanism. + for (const mechanismInRobot of editor.getMechanismsFromRobot()) { + if (mechanismInRobot.mechanismId === this.mrcMechanismId) { + for (const mechanism of editor.getMechanisms()) { + if (mechanism.moduleId === mechanismInRobot.moduleId) { + for (const privateComponent of editor.getPrivateComponentsFromMechanism(mechanism)) { + if (privateComponent.className === this.mrcComponentClassName && + privateComponent.componentId === this.mrcComponentId) { + foundComponent = true; + let warning = Blockly.Msg.WARNING_CALL_COMPONENT_INSTANCE_METHOD_PRIVATE_COMPONENT; + warning = warning.replace('{{mechanismClassName}}', mechanism.className); + warnings.push(warning); + break + } + } + break; + } + if (foundComponent) { + break; + } + } + break; + } + if (foundComponent) { + break; + } + } + } + } + + if (!foundComponent) { + warnings.push(Blockly.Msg.WARNING_CALL_COMPONENT_INSTANCE_METHOD_MISSING_COMPONENT); } if (this.mrcMechanismId) { @@ -649,9 +704,7 @@ const CALL_PYTHON_FUNCTION = { } } if (!foundMechanism) { - warnings.push( - 'This block calls a method on a component that belongs to a mechanism that no ' + - 'longer exists.'); + warnings.push(Blockly.Msg.WARNING_CALL_MECHANISM_COMPONENT_INSTANCE_METHOD_MISSING_MECHANISM); } } @@ -665,7 +718,7 @@ const CALL_PYTHON_FUNCTION = { // visible warning on it. if (this.mrcFunctionKind === FunctionKind.INSTANCE_ROBOT) { if (editor.getModuleType() === storageModule.ModuleType.MECHANISM) { - warnings.push('This block is not allowed to be used inside a mechanism.'); + warnings.push(Blockly.Msg.WARNING_CALL_ROBOT_INSTANCE_METHOD_INSIDE_MECHANISM); } else { let foundRobotMethod = false; const robotMethods = editor.getMethodsFromRobot(); @@ -695,7 +748,7 @@ const CALL_PYTHON_FUNCTION = { } } if (!foundRobotMethod) { - warnings.push('This block calls a method that no longer exists.'); + warnings.push(Blockly.Msg.WARNING_CALL_ROBOT_INSTANCE_METHOD_MISSING_METHOD); } } } @@ -711,7 +764,7 @@ const CALL_PYTHON_FUNCTION = { // visible warning on it. if (this.mrcFunctionKind === FunctionKind.INSTANCE_MECHANISM) { if (editor.getModuleType() === storageModule.ModuleType.MECHANISM) { - warnings.push('This block is not allowed to be used inside a mechanism.'); + warnings.push(Blockly.Msg.WARNING_CALL_MECHANISM_INSTANCE_METHOD_INSIDE_MECHANISM); } else { let foundMechanism = false; const mechanismsInRobot = editor.getMechanismsFromRobot(); @@ -753,7 +806,7 @@ const CALL_PYTHON_FUNCTION = { } } if (!foundMechanismMethod) { - warnings.push('This block calls a method that no longer exists.'); + warnings.push(Blockly.Msg.WARNING_CALL_MECHANISM_INSTANCE_METHOD_MISSING_METHOD); } // Since we found the mechanism, we can break out of the loop. @@ -761,7 +814,7 @@ const CALL_PYTHON_FUNCTION = { } } if (!foundMechanism) { - warnings.push('This block calls a method in a mechanism that no longer exists.'); + warnings.push(Blockly.Msg.WARNING_CALL_MECHANISM_INSTANCE_METHOD_MISSING_MECHANISM); } } } diff --git a/src/blocks/tokens.ts b/src/blocks/tokens.ts index 55b2068a..d7461962 100644 --- a/src/blocks/tokens.ts +++ b/src/blocks/tokens.ts @@ -61,6 +61,29 @@ export function customTokens(t: (key: string) => string): typeof Blockly.Msg { OPMODE_ENABLED_TOOLTIP: t('BLOCKLY.TOOLTIP.OPMODE_ENABLED'), OPMODE_NAME_TOOLTIP: t('BLOCKLY.TOOLTIP.OPMODE_NAME'), OPMODE_GROUP_TOOLTIP: t('BLOCKLY.TOOLTIP.OPMODE_GROUP'), + CALL: t('BLOCKLY.CALL'), + ROBOT_LOWER_CASE: t('BLOCKLY.ROBOT_LOWER_CASE'), + CREATE: t('BLOCKLY.CREATE'), + FIRE: t('BLOCKLY.FIRE'), + WARNING_CALL_COMPONENT_INSTANCE_METHOD_PRIVATE_COMPONENT: t('BLOCKLY.WARNING.CALL_COMPONENT_INSTANCE_METHOD_PRIVATE_COMPONENT'), + WARNING_CALL_COMPONENT_INSTANCE_METHOD_MISSING_COMPONENT: t('BLOCKLY.WARNING.CALL_COMPONENT_INSTANCE_METHOD_MISSING_COMPONENT'), + WARNING_CALL_MECHANISM_COMPONENT_INSTANCE_METHOD_MISSING_MECHANISM: t('BLOCKLY.WARNING.CALL_MECHANISM_COMPONENT_INSTANCE_METHOD_MISSING_MECHANISM'), + WARNING_CALL_ROBOT_INSTANCE_METHOD_INSIDE_MECHANISM: t('BLOCKLY.WARNING.CALL_ROBOT_INSTANCE_METHOD_INSIDE_MECHANISM'), + WARNING_CALL_ROBOT_INSTANCE_METHOD_MISSING_METHOD: t('BLOCKLY.WARNING.CALL_ROBOT_INSTANCE_METHOD_MISSING_METHOD'), + WARNING_CALL_MECHANISM_INSTANCE_METHOD_INSIDE_MECHANISM: t('BLOCKLY.WARNING.CALL_MECHANISM_INSTANCE_METHOD_INSIDE_MECHANISM'), + WARNING_CALL_MECHANISM_INSTANCE_METHOD_MISSING_METHOD: t('BLOCKLY.WARNING.CALL_MECHANISM_INSTANCE_METHOD_MISSING_METHOD'), + WARNING_CALL_MECHANISM_INSTANCE_METHOD_MISSING_MECHANISM: t('BLOCKLY.WARNING.CALL_MECHANISM_INSTANCE_METHOD_MISSING_MECHANISM'), + CALL_BUILTIN_FUNCTION_TOOLTIP: t('BLOCKLY.TOOLTIP.CALL_BUILTIN_FUNCTION'), + CALL_MODULE_FUNCTION_TOOLTIP: t('BLOCKLY.TOOLTIP.CALL_MODULE_FUNCTION'), + CALL_STATIC_METHOD_TOOLTIP: t('BLOCKLY.TOOLTIP.CALL_STATIC_METHOD'), + CALL_CONSTRUCTOR_TOOLTIP: t('BLOCKLY.TOOLTIP.CALL_CONSTRUCTOR'), + CALL_INSTANCE_METHOD_TOOLTIP: t('BLOCKLY.TOOLTIP.CALL_INSTANCE_METHOD'), + CALL_INSTANCE_METHOD_WITHIN_TOOLTIP: t('BLOCKLY.TOOLTIP.CALL_INSTANCE_METHOD_WITHIN'), + FIRE_EVENT_TOOLTIP: t('BLOCKLY.TOOLTIP.FIRE_EVENT'), + CALL_MECHANISM_COMPONENT_INSTANCE_METHOD_TOOLTIP: t('BLOCKLY.TOOLTIP.CALL_MECHANISM_COMPONENT_INSTANCE_METHOD'), + CALL_COMPONENT_INSTANCE_METHOD_TOOLTIP: t('BLOCKLY.TOOLTIP.CALL_COMPONENT_INSTANCE_METHOD'), + CALL_ROBOT_INSTANCE_METHOD_TOOLTIP: t('BLOCKLY.TOOLTIP.CALL_ROBOT_INSTANCE_METHOD'), + CALL_MECHANISM_INSTANCE_METHOD_TOOLTIP: t('BLOCKLY.TOOLTIP.CALL_MECHANISM_INSTANCE_METHOD'), MRC_CATEGORY_HARDWARE: t('BLOCKLY.CATEGORY.HARDWARE'), MRC_CATEGORY_ROBOT: t('BLOCKLY.CATEGORY.ROBOT'), MRC_CATEGORY_COMPONENTS: t('BLOCKLY.CATEGORY.COMPONENTS'), diff --git a/src/editor/editor.ts b/src/editor/editor.ts index d6af2575..7d0c21fc 100644 --- a/src/editor/editor.ts +++ b/src/editor/editor.ts @@ -451,7 +451,7 @@ export class Editor { } /** - * Returns the components defined in the given mechanism. + * Returns the regular components defined in the given mechanism. */ public getComponentsFromMechanism(mechanism: storageModule.Mechanism): storageModuleContent.Component[] { if (this.module.modulePath === mechanism.modulePath) { @@ -463,6 +463,19 @@ export class Editor { throw new Error('getComponentsFromMechanism: mechanism not found: ' + mechanism.className); } + /** + * Returns the private components defined in the given mechanism. + */ + public getPrivateComponentsFromMechanism(mechanism: storageModule.Mechanism): storageModuleContent.Component[] { + if (this.module.modulePath === mechanism.modulePath) { + return this.getPrivateComponentsFromWorkspace(); + } + if (mechanism.className in this.mechanismClassNameToModuleContent) { + return this.mechanismClassNameToModuleContent[mechanism.className].getPrivateComponents(); + } + throw new Error('getPrivateComponentsFromMechanism: mechanism not found: ' + mechanism.className); + } + /** * Returns ALL components (including private components) defined in the given mechanism. * This is used when creating mechanism blocks that need all components for port parameters. diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index ace52178..422d1c46 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -57,6 +57,10 @@ "DISPLAY_GROUP": "Display Group", "PRINT": "print", "NO_MECHANISM_CONTENTS": "No Mechanism Contents", + "CALL": "call", + "ROBOT": "robot", + "CREATE": "create", + "FIRE": "fire", "TOOLTIP":{ "EVALUATE_BUT_IGNORE_RESULT": "Executes the connected block and ignores the result. Allows you to call a function and ignore the return value.", "NONE": "Returns None.", @@ -65,7 +69,18 @@ "OPMODE_NAME": "The name shown on the Driver Station. If blank will use the class name.", "OPMODE_GROUP": "An optional group to group OpModes on Driver Station", "COMPONENTS": "These components are visible in this mechanism, the robot, and all opmodes.", - "PRIVATE_COMPONENTS": "These components will not be visible in the robot or opmodes. They are only accessible within this mechanism." + "PRIVATE_COMPONENTS": "These components will not be visible in the robot or opmodes. They are only accessible within this mechanism.", + "CALL_BUILTIN_FUNCTION": "Calls the builtin function {{functionName}}.", + "CALL_MODULE_FUNCTION": "Calls the module function {{moduleName}}.{{functionName}}.", + "CALL_STATIC_METHOD": "Calls the static method {{className}}.{{functionName}}.", + "CALL_CONSTRUCTOR": "Constructs an instance of the class {{className}}.", + "CALL_INSTANCE_METHOD": "Calls the instance method {{className}}.{{functionName}}.", + "CALL_INSTANCE_METHOD_WITHIN": "Calls the instance method {{functionName}}.", + "FIRE_EVENT": "Fires the event named {{eventName}}.", + "CALL_MECHANISM_COMPONENT_INSTANCE_METHOD": "Calls the instance method {{className}}.{{functionName}} on the component named {{componentName}} in the mechanism named {{mechanismName}}.", + "CALL_COMPONENT_INSTANCE_METHOD": "Calls the instance method {{className}}.{{functionName}} on the component named {{componentName}}.", + "CALL_ROBOT_INSTANCE_METHOD": "Calls the robot method {{functionName}}.", + "CALL_MECHANISM_INSTANCE_METHOD": "Calls the instance method {{className}}.{{functionName}} on the mechanism named {{mechanismName}}." }, "CATEGORY":{ "LISTS": "Lists", @@ -84,6 +99,16 @@ "ADD_MECHANISM": "+ Mechanism", "ADD_COMPONENT": "+ Component", "TEST": "Test" + }, + "WARNING":{ + "CALL_COMPONENT_INSTANCE_METHOD_PRIVATE_COMPONENT": "This blocks calls a method on a private component in the {{mechanismClassName}} mechanism.", + "CALL_COMPONENT_INSTANCE_METHOD_MISSING_COMPONENT": "This block calls a method on a component that no longer exists.", + "CALL_MECHANISM_COMPONENT_INSTANCE_METHOD_MISSING_MECHANISM": "This block calls a method on a component that belongs to a mechanism that no longer exists.", + "CALL_ROBOT_INSTANCE_METHOD_INSIDE_MECHANISM": "This block is not allowed to be used inside a mechanism.", + "CALL_ROBOT_INSTANCE_METHOD_MISSING_METHOD": "This block calls a method that no longer exists in the robot.", + "CALL_MECHANISM_INSTANCE_METHOD_INSIDE_MECHANISM": "This block is not allowed to be used inside a mechanism.", + "CALL_MECHANISM_INSTANCE_METHOD_MISSING_METHOD": "This block calls a method that no longer exists in the mechanism.", + "CALL_MECHANISM_INSTANCE_METHOD_MISSING_MECHANISM": "This block calls a method in a mechanism that no longer exists." } } } diff --git a/src/i18n/locales/es/translation.json b/src/i18n/locales/es/translation.json index 8c7f6201..6622e852 100644 --- a/src/i18n/locales/es/translation.json +++ b/src/i18n/locales/es/translation.json @@ -58,6 +58,10 @@ "DISPLAY_GROUP": "Grupo a Mostrar", "PRINT": "imprimir", "NO_MECHANISM_CONTENTS": "Sin Contenido de Mecanismo", + "CALL": "llamar", + "ROBOT": "robot", + "CREATE": "crear", + "FIRE": "disparar", "TOOLTIP": { "EVALUATE_BUT_IGNORE_RESULT": "Ejecuta el bloque conectado e ignora el resultado. Te permite llamar una función e ignorar el valor de retorno.", "NONE": "No devuelve ninguno.", @@ -66,7 +70,18 @@ "OPMODE_NAME": "El nombre mostrado en la Estación del Conductor. Si está en blanco usará el nombre de la clase.", "OPMODE_GROUP": "Un grupo opcional para agrupar OpModes en la Estación del Conductor", "COMPONENTS": "Estos componentes son visibles en este mecanismo, el robot y todos los opmodes.", - "PRIVATE_COMPONENTS": "Estos componentes no serán visibles en el robot o en los opmodes. Solo son accesibles dentro de este mecanismo." + "PRIVATE_COMPONENTS": "Estos componentes no serán visibles en el robot o en los opmodes. Solo son accesibles dentro de este mecanismo.", + "CALL_BUILTIN_FUNCTION": "Llama a la función incorporada {{functionName}}.", + "CALL_MODULE_FUNCTION": "Llama a la función del módulo {{moduleName}}.{{functionName}}.", + "CALL_STATIC_METHOD": "Llama al método estático {{className}}.{{functionName}}.", + "CALL_CONSTRUCTOR": "Construye una instancia de la clase {{className}}.", + "CALL_INSTANCE_METHOD": "Llama al método de instancia {{className}}.{{functionName}}.", + "CALL_INSTANCE_METHOD_WITHIN": "Llama al método de instancia {{functionName}}.", + "FIRE_EVENT": "Dispara el evento llamado {{eventName}}.", + "CALL_MECHANISM_COMPONENT_INSTANCE_METHOD": "Llama al método de instancia {{className}}.{{functionName}} en el componente llamado {{componentName}} en el mecanismo llamado {{mechanismName}}.", + "CALL_COMPONENT_INSTANCE_METHOD": "Llama al método de instancia {{className}}.{{functionName}} en el componente llamado {{componentName}}.", + "CALL_ROBOT_INSTANCE_METHOD": "Llama al método robot {{functionName}}.", + "CALL_MECHANISM_INSTANCE_METHOD": "Llama al método de instancia {{className}}.{{functionName}} en el mecanismo llamado {{mechanismName}}." }, "CATEGORY": { "LISTS": "Listas", @@ -85,6 +100,16 @@ "ADD_MECHANISM": "+ Mecanismo", "ADD_COMPONENT": "+ Componente", "TEST": "Prueba" + }, + "WARNING":{ + "CALL_COMPONENT_INSTANCE_METHOD_PRIVATE_COMPONENT": "Este bloque llama a un método en un componente privado en el mecanismo {{mechanismClassName}}.", + "CALL_COMPONENT_INSTANCE_METHOD_MISSING_COMPONENT": "Este bloque llama a un método en un componente que ya no existe.", + "CALL_MECHANISM_COMPONENT_INSTANCE_METHOD_MISSING_MECHANISM": "Este bloque llama a un método de un componente que pertenece a un mecanismo que ya no existe.", + "CALL_ROBOT_INSTANCE_METHOD_INSIDE_MECHANISM": "No se permite utilizar este bloque dentro de un mecanismo.", + "CALL_ROBOT_INSTANCE_METHOD_MISSING_METHOD": "Este bloque llama a un método que ya no existe en el robot.", + "CALL_MECHANISM_INSTANCE_METHOD_INSIDE_MECHANISM": "No se permite utilizar este bloque dentro de un mecanismo.", + "CALL_MECHANISM_INSTANCE_METHOD_MISSING_METHOD": "Este bloque llama a un método que ya no existe en el mecanismo.", + "CALL_MECHANISM_INSTANCE_METHOD_MISSING_MECHANISM": "Este bloque llama a un método en un mecanismo que ya no existe." } } } diff --git a/src/i18n/locales/he/translation.json b/src/i18n/locales/he/translation.json index de9f7fde..aa3c0044 100644 --- a/src/i18n/locales/he/translation.json +++ b/src/i18n/locales/he/translation.json @@ -57,6 +57,10 @@ "DISPLAY_GROUP": "קבוצת תצוגה", "PRINT": "הדפס", "NO_MECHANISM_CONTENTS": "אין תוכן מנגנון", + "CALL": "שִׂיחָה", + "ROBOT": "רובוט", + "CREATE": "לִיצוֹר", + "FIRE": "לִגרוֹם", "TOOLTIP":{ "EVALUATE_BUT_IGNORE_RESULT": "מריץ את הבלוק המחובר ומתעלם מהתוצאה. מאפשר לך לקרוא לפונקציה ולהתעלם מערך ההחזרה.", "NONE": "החזרות אין.", @@ -65,7 +69,18 @@ "OPMODE_NAME": "השם המוצג בתחנת הנהג. אם ריק ישתמש בשם הכיתה.", "OPMODE_GROUP": "קבוצה אופציונלית לקיבוץ מצבי פעולה בתחנת הנהג", "COMPONENTS": "רכיבים אלה גלויים במנגנון זה, ברובוט ובכל מצבי הפעולה.", - "PRIVATE_COMPONENTS": "רכיבים אלה לא יהיו גלויים ברובוט או במצבי פעולה. הם נגישים רק בתוך המנגנון הזה." + "PRIVATE_COMPONENTS": "רכיבים אלה לא יהיו גלויים ברובוט או במצבי פעולה. הם נגישים רק בתוך המנגנון הזה.", + "CALL_BUILTIN_FUNCTION": "קורא לפונקציה המובנית {{functionName}}.", + "CALL_MODULE_FUNCTION": "קורא לפונקציית המודול {{moduleName}}.{{functionName}}.", + "CALL_STATIC_METHOD": "קורא למתודה הסטטית {{className}}.{{functionName}}.", + "CALL_CONSTRUCTOR": "בונה מופע של המחלקה {{className}}.", + "CALL_INSTANCE_METHOD": "קורא למתודה {{className}}.{{functionName}}.", + "CALL_INSTANCE_METHOD_WITHIN": "קורא למתודה {{functionName}}.", + "FIRE_EVENT": "מפעיל את האירוע בשם {{eventName}}.", + "CALL_MECHANISM_COMPONENT_INSTANCE_METHOD": "קורא למתודה {{className}}.{{functionName}} על הרכיב בשם {{componentName}} במנגנון בשם {{mechanismName}}.", + "CALL_COMPONENT_INSTANCE_METHOD": "קורא למתודה {{className}}.{{functionName}} על הרכיב בשם {{componentName}}.", + "CALL_ROBOT_INSTANCE_METHOD": "קורא למתודה הרובוטית {{functionName}}.", + "CALL_MECHANISM_INSTANCE_METHOD": "קורא למתודה {{className}}.{{functionName}} במנגנון בשם {{mechanismName}}." }, "CATEGORY":{ "LISTS": "רשימות", @@ -84,6 +99,16 @@ "ADD_MECHANISM": "+ מנגנון", "ADD_COMPONENT": "+ רכיב", "TEST": "בדיקה" + }, + "WARNING":{ + "CALL_COMPONENT_INSTANCE_METHOD_PRIVATE_COMPONENT": "פעולה זו חוסם קריאה למתודה על רכיב פרטי במנגנון {{mechanismClassName}}.", + "CALL_COMPONENT_INSTANCE_METHOD_MISSING_COMPONENT": "בלוק זה קורא למתודה על רכיב שכבר אינו קיים.", + "CALL_MECHANISM_COMPONENT_INSTANCE_METHOD_MISSING_MECHANISM": "בלוק זה קורא למתודה על רכיב השייך למנגנון שכבר אינו קיים.", + "CALL_ROBOT_INSTANCE_METHOD_INSIDE_MECHANISM": "אסור להשתמש בבלוק זה בתוך מנגנון.", + "CALL_ROBOT_INSTANCE_METHOD_MISSING_METHOD": "בלוק זה קורא למתודה שכבר לא קיימת ברובוט.", + "CALL_MECHANISM_INSTANCE_METHOD_INSIDE_MECHANISM": "אסור להשתמש בבלוק זה בתוך מנגנון.", + "CALL_MECHANISM_INSTANCE_METHOD_MISSING_METHOD": "בלוק זה קורא לשיטה שכבר אינה קיימת במנגנון.", + "CALL_MECHANISM_INSTANCE_METHOD_MISSING_MECHANISM": "בלוק זה קורא לשיטה במנגנון שכבר אינו קיים." } } }