Skip to content

Adopt @microbit/ui-patterns' LanguageDialog - #1261

Merged
microbit-matt-hillsdon merged 2 commits into
mainfrom
language-dialog-pattern
Aug 14, 2026
Merged

Adopt @microbit/ui-patterns' LanguageDialog#1261
microbit-matt-hillsdon merged 2 commits into
mainfrom
language-dialog-pattern

Conversation

@microbit-matt-hillsdon

@microbit-matt-hillsdon microbit-matt-hillsdon commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Upgrade @microbit/ui to 0.1.0-alpha.25 and add @microbit/ui-patterns 0.1.0-alpha.2. The dialog becomes a thin wrapper over the shared pattern (flat grid, preview markers, deployment-sourced help-translate link); its hardcoded English preview footnote is finally a translated message. The ui upgrade also brings tracking the language setting, via SharedUIProvider.

First-run language now matches browser/OS preferences (after the ?l= hint) via the shared getDefaultLanguageId — previously only ?l= was honoured. Language ids take the registry's canonical BCP 47 casing (zh-CN, zh-TW, es-ES, ga-IE) and the KnownLanguageId union; stored settings and inbound ?l= links with the old lowercase ids keep working via case-insensitive reads, and the lowercase-keyed consumers (catalog imports, typeshed/pyright locale) normalise at their boundaries.

Panda includes the package's sources, compile-lang merges its catalogs, and our help-translate string retires in its favour (language stays: the menu item).

To check:

  • Language dialog strings themselves are translated as expected
  • l= parameter still works
  • html lang updates as per chosen default and your choice
  • Stored language settings from before still work
    • This is true, but the stored format does change from es-es to es-ES and the old code ignores the new format if we revert. No bad consequences other than the setting falling back to English but we should check other apps don't explode. This came indirectly from wanting a valid code to put on HTML lang and is probably sensible but just need to be careful.

Upgrade @microbit/ui to 0.1.0-alpha.25 and add @microbit/ui-patterns
0.1.0-alpha.2. The dialog becomes a thin wrapper over the shared pattern
(flat grid, preview markers, deployment-sourced help-translate link);
its hardcoded English preview footnote is finally a translated message.
The ui upgrade also brings <html lang> tracking the language setting,
via SharedUIProvider.

First-run language now matches browser/OS preferences (after the ?l=
hint) via the shared getDefaultLanguageId — previously only ?l= was
honoured. Language ids take the registry's canonical BCP 47 casing
(zh-CN, zh-TW, es-ES, ga-IE) and the KnownLanguageId union; stored
settings and inbound ?l= links with the old lowercase ids keep working
via case-insensitive reads, and the lowercase-keyed consumers (catalog
imports, typeshed/pyright locale) normalise at their boundaries.

Panda includes the package's sources, compile-lang merges its catalogs,
and our help-translate string retires in its favour (`language` stays:
the menu item).
@github-actions

Copy link
Copy Markdown

The external-link icon sits centred on the text again, and the language
dialog compacts (narrower modal, two columns) when six or fewer
languages are offered.

@microbit-robert microbit-robert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@microbit-matt-hillsdon
microbit-matt-hillsdon merged commit 3974e9d into main Aug 14, 2026
1 check passed
@microbit-matt-hillsdon
microbit-matt-hillsdon deleted the language-dialog-pattern branch August 14, 2026 09:43
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.

2 participants