Repository navigation
Localize Tutorial Tool and forward locale to embedded editors - #11626
Christian BR (ChrisesDK) wants to merge 4 commits into
Conversation
56dc276 to
a9fac7d
Compare
a9fac7d to
2d01cf3
Compare
|
Rebased onto current Joey Wunderlich (@jwunderl), could you please review the Tutorial Tool localization and embedded-editor locale-forwarding approach when you have capacity? The URL handling intentionally preserves an editor's explicit The new fork-PR Actions runs are currently at GitHub's |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved locale-forwarding bugs can ignore explicit language selections or override saved editor preferences, while an unnecessary API-catalog download delays startup for non-English users.
4 open issues
What changed in this PR
Adds localization support to the React Tutorial Tool using PXT’s existing translation infrastructure and forwards locale requests to embedded MakeCode editors.
Changes:
- Initializes localization before rendering and localizes document metadata and iframe labels.
- Extends translation catalog loading, publication, and extraction tasks for the Tutorial Tool.
- Adds locale-aware iframe URL helpers and focused regression tests.
| File | Description |
|---|---|
tutorialtool/tests/tsconfig.json |
Configures the focused TypeScript tests. |
tutorialtool/tests/localizationExtraction.spec.ts |
Checks extraction configuration and expected translation keys. |
tutorialtool/tests/legacyIframeUrl.spec.ts |
Tests locale forwarding through the legacy helper. |
tutorialtool/tests/iframeUrl.spec.ts |
Tests locale forwarding and preservation of URL parameters. |
tutorialtool/src/utils/localization.ts |
Selects the locale, initializes translations, and localizes metadata. |
tutorialtool/src/utils/iframeUrl.ts |
Adds locale parsing and editor URL construction helpers. |
tutorialtool/src/index.tsx |
Initializes localization before analytics and rendering. |
tutorialtool/src/components/MakeCodeFrame.tsx |
Uses locale-aware URLs and adds a localized iframe title. |
tests/pxt-editor-test/editorrunner.ts |
Tests Tutorial Tool runtime catalog loading. |
pxtlib/util.ts |
Adds Tutorial Tool translation-kind support. |
gulpfile.js |
Adds extraction and test tasks to the build workflow. |
docs/static/tutorial-tool/tutorial.ts |
Adds locale forwarding to the legacy iframe source. |
cli/crowdin.ts |
Includes Tutorial Tool catalogs in translation publication. |
Review effort: Max
2d01cf3 to
119ca93
Compare
|
Rebased onto current
Added regression coverage for explicit English and the legacy fallback behavior. Validation passes: 17/17 Tutorial Tool tests and 93/93 PXT editor tests. Joey Wunderlich (@jwunderl), these fixes landed after the earlier approval; all four threads are resolved and the branch is ready for a fresh review when convenient. |
119ca93 to
550a1fd
Compare
|
Rebased onto current Fresh validation passes:
Joey Wunderlich (@jwunderl), the branch is mergeable again and ready for a fresh review when convenient. |

Summary
Adds generic localization support to the current React-based MakeCode Tutorial Tool and forwards the active locale to embedded MakeCode editors.
Changes
TranslationsKind.TutorialToolruntime supportlang/forcelangto embedded MakeCode editors while preserving existing locale parametersValidation
gulp tutorialtoolTest- 11 passinggulp pxtlib- passedgulp testpxteditor- 66 passinggit diff --check- passedThe full React build was not run locally because the local Tutorial Tool dependency installation does not contain
react-app-rewired. The standalone Tutorial Tool typecheck is also blocked by the existingpxtarget.d.tstypesconfiguration issue; neither issue is introduced by this patch.Scope
This PR is generic and does not contain Danish-specific translations.
Out of scope: