localize on-screen keyboard#2
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes the on-screen text-entry keyboard localizable by introducing locale-driven (and per-modal override) character sets for letters, accents, and symbols, plus an optional accents keyboard page when a language provides accent data.
Changes:
- Extend
_locwith keyboard charset fields and resolve an effective charset at text-entry/modal construction time. - Rework keyboard grid layout to support variable letter row counts and add an accents page that participates in page-cycling.
- Add locale charset data (
locales/charsets.json) and smoke tests covering charset injection and accents-page behavior; update sample usage and localization docs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| text-entry.ts | Adds _loc charset fields, charset resolution, dynamic keyboard layout, and an accents page. |
| test.ts | Adds smoke tests validating injected charsets, per-modal overrides, caseless behavior, and accents page behavior. |
| scripts/locstrings.mjs | Removes the local string-extractor script (intended to be replaced by a shared tool). |
| samples.ts | Localizes a sample caption and demonstrates direct _loc assignment for Spanish/French keyboard behavior. |
| package.json | Switches loc:strings script and adds a @microbit-apps/ui-core devDependency. |
| locales/README.md | Documents keyboard charset fields and usage. |
| locales/charsets.json | Adds per-language keyboard charset data for 16 languages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
humanapp
marked this pull request as ready for review
July 23, 2026 06:41
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.
ui-controls: localized on-screen keyboards
Makes the on-screen keyboard localizable. Per-language character sets ride the
existing locale-layer channel, so any consumer gets localized text entry for
free. Fully serves all 16 non-CJK languages, verified on hardware (fr, es, ru).
text-entry.ts— declares the keyboard_loccharset fields (alphabet,accents, symbols) via namespace-extension; resolves them at construction
(per-modal override ›
_loc› ASCII default). Layout, case mapping, shiftvisibility, and the input filter derive from the resolved set; the filter fix
also stops
initialTextfrom dropping accents. Adds an accents page (afourth keyboard page, present only when a language has accents) and spreads
digit/symbol keys evenly across rows.
locales/charsets.json— keyboard data for 16 languages, glyph-validatedagainst font8.
samples.tsdemo; README section.loc:stringsvia the shared bin; local extractor removed.Parked as draft until ui-core bump, pending microbit-apps/ui-core#2