Skip to content

i18n prototype: locale, Fluent and ICU4X - #107

Merged
1bye merged 4 commits into
mainfrom
codex/i18n-prototype-21
Nov 23, 2026
Merged

1bye merged 4 commits into
mainfrom
codex/i18n-prototype-21

Conversation

@1bye

@1bye 1bye commented Nov 21, 2026

Copy link
Copy Markdown
Owner

What works

  • Installs embedded English and European Portuguese catalogues. System and explicit selection share negotiation. A locale change updates the GPUI global and refreshes all windows.
  • Renders Fluent messages using explicit rake::t!(cx, ...). Missing messages and argument failures display the key with a diagnostic. The inbox demonstrates cardinal plurals, decimals and Gregorian date-only formatting.
  • Exposes translated accessible names and exact message-key queries in CDP and rake ctl. Drove both native windows through repeated language switches, including opening a window after switching. Browser renders matched the native decimal and date values in both locales.
  • Observed Kit's own English fallback and verified that an app-supplied placeholder updates on the same retained Kit control. The pinned Kit has pt-BR coverage and lacks pt-PT and pt catalogues.

Web release size

The full prototype adds 189,485 bytes with gzip or 137,372 bytes with Brotli, both within the provisional 300 KB compressed budget. Fluent only adds 121,196 gzip bytes or 94,306 Brotli bytes. The ICU provider is 4,734 bytes. The prototype report records the raw and compressed Wasm and JS matrix, exact commands, output comparisons and observed initialization times.

Compromises and follow-up API

  • Keep explicit cx and literal Fluent keys. Move catalogue coverage and argument checks into tooling, and settle regional and script matching before standardizing locale negotiation.
  • Fluent 0.16 hard-wires its numeric matcher. The prototype's PLURAL($count) uses the same ICU4X rule instance as the public plural API. Raw numeric selectors still reach Fluent's matcher, and its plural code still ships. Prefer an upstream resolver hook or validated ICU category selectors before stabilizing the API.
  • Use a typed civil date and explicit formatting options in the stable API. The prototype takes Gregorian year, month and day and uses one date length. The Intl comparison, wider locale sets and fine-grained latency measurements remain follow-up work.
  • Keep the one-way Kit bridge and replace the pinned locale list with a supported inventory when available. Host language changes use explicit re-detection. Message keys are available at inspectable Rake boundaries, with opaque Kit descendants and flattened paragraph runs outside the capture.

Refs #21, #100, #101, #102, #104 and #105.

1bye and others added 4 commits November 21, 2026 21:01
Kit 0.9 ships Portuguese only as pt-BR; a regional sibling is closer to
the user's language than English, per review.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Resolves overlaps with the secrets API dependencies (#98) and the
link and selection view tests (#99).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@1bye
1bye marked this pull request as ready for review November 23, 2026 13:06
@1bye
1bye merged commit ff8edb5 into main Nov 23, 2026
13 checks 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.

1 participant