Localize generated variable and SpriteKind labels without changing identity - #11615
Open
Christian BR (ChrisesDK) wants to merge 2 commits into
Open
Christian BR (ChrisesDK) wants to merge 2 commits into
Christian BR (ChrisesDK) wants to merge 2 commits into
Conversation
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PXT upstream pull request
Title
Localize generated variable and SpriteKind labels without changing identityBase and head
microsoft/pxt:masterChrisesDK:complete-rendered-label-localizationcomplete-rendered-label-localizationat95be24b3dffb214754245672cad28722397e7d40Description
Summary
Some pupil-visible generated/default Blockly variable labels and built-in
SpriteKindlabels currently render raw identifiers, so they cannot belocalized through the normal MakeCode localization pipeline. This change
separates localized display text from stored and compiler-facing identity.
It adds opt-in, display-only localization for generated/default variable labels
and localized display labels for built-in
SpriteKinddropdown members.When MakeCode automatically uniquifies a generated default variable name,
numbered variants reuse the localized display of the base concept. For example,
generated
mySprite2andmySprite3display as the localized form ofmySpritefollowed by the raw suffixes2and3, without creating separatelocalization keys.
Compatibility
SpriteKinddropdown values remain raw (Player,Projectile,Food, andEnemy).behavior; a matching standalone user variable is not globally aliased.
production hardcoding.
Localization surface
This exposes 14 localization concepts:
{id:var}anim{id:var}location{id:var}myTile{id:var}tile list{id:var}projectile{id:var}otherSprite{id:var}myEnemy{id:var}picture{id:var}mySprite{id:var}listSpriteKind.PlayerSpriteKind.ProjectileSpriteKind.FoodSpriteKind.EnemyThe localization gaps addressed by this change were validated against the
rendered block-label mechanisms observed during a Danish Arcade localization
review. This is implementation-validation context, not formal exhaustive QA.
Validation
original verified implementation.
The final branch does not have a fresh complete Karma run: Puppeteer's cached
Chrome executable is unavailable locally. This is an environment block, not an
observed implementation test failure. A final combined rerun stopped after 427
passing tests at that browser-launch step and was not a complete combined run.
No implementation failure has been observed; normal upstream CI is still
expected.
Follow-up
pxt-common-packageshas a dependent follow-up that opts the relevant Arcadelibrary surfaces into this generic PXT capability. PXT must land and be
synchronized before that follow-up is merged.
Out of scope
This source PR deliberately does not include ordinary Crowdin wording fixes,
Crowdin-to-Arcade publication lag, Danish terminology decisions, or enabling
the
dalocale. Those are separate localization-content and deployment work.