Skip to content

add translatable ariaLabel to block dropdown items#11416

Open
riknoll wants to merge 2 commits into
masterfrom
dev/riknoll/microbit-dropdown-option-loc
Open

add translatable ariaLabel to block dropdown items#11416
riknoll wants to merge 2 commits into
masterfrom
dev/riknoll/microbit-dropdown-option-loc

Conversation

@riknoll

@riknoll riknoll commented Jun 22, 2026

Copy link
Copy Markdown
Member

redo of #11399

adds a translatable aria label to dropdown values in blocks. that includes things like enums and getters/setters that are automatically converted into dropdown lists.

this works just like the localization of the block string and jsdoc string; it gets overwritten in the symbol info when we localize the APIs so there is no need to call rlf when referencing it.

you can also translate it on the block definition itself like so:

//% weight=100 color=#0fbc11 icon=""
namespace custom {
    export class MyClass {
        //% blockSetVariable="mySprite"
        //% blockCombine block="x" callInDebugger
        //% ariaLabel="hello"
        //% ariaLabel.loc.ru="nyet"
        get x(): number {
            return 0;
        }

        //% group="Physics" blockSetVariable="mySprite"
        //% blockCombine block="x"
        //% ariaLabel="hello"
        //% ariaLabel.loc.ru="nyet"
        set x(value: number) {

        }
    }
}

(obviously i don't speak russian)

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.

1 participant