Skip to content

Commit

Permalink
Fix actions disappearing when wrongly translated with the same name i…
Browse files Browse the repository at this point in the history
…n a non english language translation

Fix #5565
  • Loading branch information
4ian committed Aug 14, 2023
1 parent 4a4bf6d commit 0d325f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<ListItem
key={value}
primaryText={key}
primaryText={instructionMetadata.displayedName}
selected={selected}
id={
// TODO: This id is used by in app tutorials. When in app tutorials
// are linked to GDevelop versions, change this id to be more accurate
// using getInstructionOrExpressionIdentifier
'instruction-item-' +
instructionInformation.type.replace(/:/g, '-')
instructionMetadata.type.replace(/:/g, '-')
}
leftIcon={
<ListIcon
iconSize={iconSize}
src={instructionInformation.iconFilename}
src={instructionMetadata.iconFilename}
/>
}
onClick={() => {
onChoose(instructionInformation.type, instructionInformation);
onChoose(instructionMetadata.type, instructionMetadata);
}}
ref={selected ? selectedItemRef : undefined}
/>
Expand Down
6 changes: 3 additions & 3 deletions newIDE/app/src/InstructionOrExpression/CreateTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const createTree = <T: EnumeratedInstructionOrExpressionMetadata>(
const existingGroupInfo = groupInfo || {};
return {
...existingGroupInfo,
[expressionInfo.displayedName]: expressionInfo,
[expressionInfo.type]: expressionInfo,
};
});
});
Expand All @@ -65,9 +65,9 @@ export const findInTree = <T: Object>(

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 {
Expand Down

0 comments on commit 0d325f3

Please sign in to comment.