Skip to content

Commit

Permalink
also translate descriptions for hw
Browse files Browse the repository at this point in the history
  • Loading branch information
jwunderl committed Sep 27, 2023
1 parent 7173ef7 commit 688081b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1919,6 +1919,13 @@ ${gcards.map(gcard => `[${gcard.name}](${gcard.url})`).join(',\n')}
targetStrings[`{id:extension-tag}${tag}`] = tag;
}
}

const hardwareOptions = targetConfig?.hardwareOptions;
for (const opt of (hardwareOptions ?? [])) {
// Not translating hardware name, as that is typically a brand name / etc.
if (opt.description)
targetStrings[`{id:hardware-description}${opt.description}`] = opt.description;
}
}
// extract strings from editor
["editor", "fieldeditors", "cmds"]
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,7 @@ export class ChooseHwDialog extends data.Component<ISettingsProps, ChooseHwDialo
key={'card' + card.name}
name={card.name}
ariaLabel={card.name}
description={card.description}
description={pxt.Util.rlf(`{id:hardware-description}${card.description}`)}
imageUrl={card.imageUrl}
learnMoreUrl={card.url}
onClick={card.onClick}
Expand Down

0 comments on commit 688081b

Please sign in to comment.