From 0d325f376d41cf63cb0e95b59a0e9c0157b36dae Mon Sep 17 00:00:00 2001 From: Florian Rival Date: Mon, 14 Aug 2023 22:07:13 +0200 Subject: [PATCH] Fix actions disappearing when wrongly translated with the same name in a non english language translation Fix #5565 --- .../SelectorInstructionsTreeListItem.js | 10 +++++----- newIDE/app/src/InstructionOrExpression/CreateTree.js | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/newIDE/app/src/EventsSheet/InstructionEditor/SelectorListItems/SelectorInstructionsTreeListItem.js b/newIDE/app/src/EventsSheet/InstructionEditor/SelectorListItems/SelectorInstructionsTreeListItem.js index 48b54203a532..5073098b1c8f 100644 --- a/newIDE/app/src/EventsSheet/InstructionEditor/SelectorListItems/SelectorInstructionsTreeListItem.js +++ b/newIDE/app/src/EventsSheet/InstructionEditor/SelectorListItems/SelectorInstructionsTreeListItem.js @@ -50,29 +50,29 @@ export const renderInstructionOrExpressionTree = < if (typeof instructionOrGroup.type === 'string') { // $FlowFixMe - see above - const instructionInformation: T = instructionOrGroup; + const instructionMetadata: T = instructionOrGroup; const value = getInstructionListItemValue(instructionOrGroup.type); const selected = selectedValue === value; return ( } onClick={() => { - onChoose(instructionInformation.type, instructionInformation); + onChoose(instructionMetadata.type, instructionMetadata); }} ref={selected ? selectedItemRef : undefined} /> diff --git a/newIDE/app/src/InstructionOrExpression/CreateTree.js b/newIDE/app/src/InstructionOrExpression/CreateTree.js index 4c739e4165b9..aeb6a8a2de4c 100644 --- a/newIDE/app/src/InstructionOrExpression/CreateTree.js +++ b/newIDE/app/src/InstructionOrExpression/CreateTree.js @@ -38,7 +38,7 @@ export const createTree = ( const existingGroupInfo = groupInfo || {}; return { ...existingGroupInfo, - [expressionInfo.displayedName]: expressionInfo, + [expressionInfo.type]: expressionInfo, }; }); }); @@ -65,9 +65,9 @@ export const findInTree = ( if (typeof instructionOrGroup.type === 'string') { // $FlowFixMe - see above - const instructionInformation: EnumeratedInstructionOrExpressionMetadata = instructionOrGroup; + const instructionMetadata: EnumeratedInstructionOrExpressionMetadata = instructionOrGroup; - if (instructionInformation.type === instructionType) { + if (instructionMetadata.type === instructionType) { return []; } } else {