Skip to content
This repository was archived by the owner on Nov 17, 2024. It is now read-only.

Commit 5df1e0a

Browse files
author
Cosmo Myzrail Gorynych
committed
🐛 Fix catnip blocks ignoring translations when there was a translated name without a translated label
1 parent 6a615f3 commit 5df1e0a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/node_requires/catnip/blockUtils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,12 @@ export const convertFromDtsToBlocks = (usefuls: usableDeclaration[], lib: 'core'
9393
name = node.comment.toString();
9494
} else if (String(node.tagName.escapedText).startsWith('catnipName_') && node.comment) {
9595
// Localized names for this block
96-
const key = String(node.tagName.escapedText).replace('catnipName_', 'name_');
96+
const key = String(node.tagName.escapedText).replace('catnipName_', 'name_'),
97+
displayNameKey = String(node.tagName.escapedText).replace('catnipName_', 'displayName_');
9798
extraNames[key] = node.comment.toString().trim();
99+
if (!extraNames[displayNameKey]) {
100+
extraNames[displayNameKey] = extraNames[key];
101+
}
98102
} else if (String(node.tagName.escapedText).startsWith('catnipLabel_') && node.comment) {
99103
// Localized display names for this block
100104
const key = String(node.tagName.escapedText).replace('catnipLabel_', 'displayName_');

0 commit comments

Comments
 (0)