add ability to localize callback parameters #10567
Merged
+59
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes microsoft/pxt-microbit#1507
this PR adds the ability to localize callback parameters in blocks with draggable reporters. the json entries for callback parameters look like this:
i went with this format over the usual
{id:whatever}
thing we use for mostrlf
strings because i wanted to match what we do for the other block strings, which i guess predate the nicer curly brace syntax.in order to actually display these strings, i store this localization
rlf
key as a mutation in the block when generating XML for the toolbox. that means this will not retroactively apply to old projects, which will not have the mutation present. also, this will still compile to the actual parameter name when switching to javascript rather than the localized one