Skip to content

localize on-screen keyboard#2

Merged
humanapp merged 4 commits into
mainfrom
humanapp/text-entry-loc
Jul 23, 2026
Merged

localize on-screen keyboard#2
humanapp merged 4 commits into
mainfrom
humanapp/text-entry-loc

Conversation

@humanapp

Copy link
Copy Markdown
Collaborator

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).

image
  • text-entry.ts — declares the keyboard _loc charset fields (alphabet,
    accents, symbols) via namespace-extension; resolves them at construction
    (per-modal override › _loc › ASCII default). Layout, case mapping, shift
    visibility, and the input filter derive from the resolved set; the filter fix
    also stops initialText from dropping accents. Adds an accents page (a
    fourth 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-validated
    against font8.
  • Additive charset + accents tests; a Spanish samples.ts demo; README section.
  • Tooling devDependency + loc:strings via the shared bin; local extractor removed.

Parked as draft until ui-core bump, pending microbit-apps/ui-core#2

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 _loc with 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.

Comment thread text-entry.ts
Comment thread package.json
Comment thread locales/README.md Outdated
@humanapp
humanapp marked this pull request as ready for review July 23, 2026 06:41
@humanapp
humanapp merged commit 6227668 into main Jul 23, 2026
1 check passed
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