Skip to content

extracting locales for default string arguments on blocks#11406

Merged
jwunderl merged 2 commits into
masterfrom
dev/jwunderl/extract-locales-defls
Jun 19, 2026
Merged

extracting locales for default string arguments on blocks#11406
jwunderl merged 2 commits into
masterfrom
dev/jwunderl/extract-locales-defls

Conversation

@jwunderl

Copy link
Copy Markdown
Member

fix microsoft/pxt-microbit#6687

extracting out .defl= and e.g. defaults we use for parameter defaults (it looks like still some not checked in for e.g. unit conversions and color helpers from build), but these are the ones it'll add into microbit / will check in updated locales files after getting this in to update baseline:
image
image
image
image

@jwunderl jwunderl requested a review from a team June 12, 2026 16:30
@jwunderl jwunderl changed the title start on extracting locales for default values extracting locales for default string arguments on blocks Jun 12, 2026
Comment thread pxtlib/blocks.ts

export function parameterDefaultToLocalizationString(defaultValue: string, type?: string) {
if (!defaultValue) return undefined;
if (type === "string" && defaultValue.charAt(0) !== "\"") return defaultValue;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be

Suggested change
if (type === "string" && defaultValue.charAt(0) !== "\"") return defaultValue;
if (type === "string" && defaultValue.charAt(0) === "\"") return defaultValue;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the is the 'bail out if the default value is not explicitly a string' check, e.g. if this is set to a blockid for a block that returns a string

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, gotcha, thanks for the clarification!

@jwunderl jwunderl enabled auto-merge (squash) June 19, 2026 20:56
@jwunderl jwunderl merged commit e9cdb39 into master Jun 19, 2026
20 checks passed
@jwunderl jwunderl deleted the dev/jwunderl/extract-locales-defls branch June 19, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Translations missing for some default values

2 participants