Skip to content

Settings: localize the connectors runtime strings - #3476

Merged
Birfy merged 1 commit into
mainfrom
dev/3438-settings-connectors-strings
Nov 30, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/3438-settings-connectors-strings

Conversation

@Birfy

@Birfy Birfy commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

/settings renders its connectors panel through applySystemLocale(), which swaps
data-ui-* marker text when the page language is English. The panel's state, however,
is written afterwards by composioRowState() and composioMessage() from inline Chinese
literals in flybot_workspace/static/settings/app.mjs. So an English page keeps a Chinese
connectors panel: 46 strings over 42 lines (416 Han characters in the connectors block,
704 in the file).

That is the case #3438 describes — unmarked Chinese strings survive the English render.

Change

  • One CONNECTORS_CHOICES zh/en table inside settings/app.mjs, read through a new
    connectorsText(document, key, values) wrapper over the existing uiText().
  • Catalog keys that already existed (settings.connectors.connect,
    settings.connectors.loading, …) are reused through uiText()'s catalog fallback instead
    of being copied into the table, so marker text and runtime text cannot drift apart.
  • composioRowState(..., t = null) and composioMessage(..., t = null) take an optional
    translator. Without it they fall back to the table's Chinese side, so every existing
    caller keeps its exact bytes.
  • docs/inventory/visible-controls.json is regenerated with the tree's own
    scripts/visible_inventory.py because the file moved four document.createElement sites
    to new lines.

Out of scope

  • No change to the shell catalog, to system-locale.mjs, or to the /chat page.
  • No new settings-page dictionary: the table lives next to the strings that use it.
  • Chinese output is unchanged; this slice only fills in the English side.

Verification (local, run by FlyBot Lead on the pushed content)

Content of the three files is byte-identical to the blobs pushed here
(e928a8f5, 70d8296d, f99d9fb2), verified by git hash-object against the API blobs.

  • node --test --test-concurrency=2 tests/settings_page.test.mjs tests/system_locale.test.mjs tests/system_locale_settings.test.mjs tests/system_locale_chat.test.mjs
    → 49/49 pass (0 fail), including the new English connectors assertion.
  • python3 -m unittest tests.test_settings_page tests.test_visible_inventory
    → 23 tests OK.
  • python3 scripts/visible_inventory.py regenerates docs/inventory/visible-controls.json
    byte-for-byte (sha256 104e84f3…), so the committed inventory is self-consistent.

Local readings only — CI has not run on this head yet.

Refs #3438

The connectors panel wrote its row states and error messages from inline
Chinese literals inside app.mjs, so the English render left that panel in
Chinese even with the panel marked for localization. Collect those phrases
into one zh/en table behind connectorsText(), reuse the catalog keys that
already existed instead of copying them, and let composioRowState() and
composioMessage() take an optional translator while the Chinese default
stays byte-identical for existing callers.

Refs #3438.
@github-actions github-actions Bot added the risk:T1 Risk tier T1 (client, tests, generated files), set by the controller from the diff label Nov 30, 2026
@Birfy

Birfy commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator Author

Lead review — slice: connectors runtime strings follow the interface language.

Head: e80b7a150dcd8c6c2444c7dcf01a9531f31889b9
Parent: f55e481be3524ebaf568f60fea1275aad73622b9 (main)
Tree: a70e8f45e2a78f31fb02900dd411ac6217ccbc48
Diff: 3 files, +184/-54 (single commit)

What changes

  • flybot_workspace/static/settings/app.mjs, tests/settings_page.test.mjs,
    docs/inventory/visible-controls.json.
  • The connectors panel now resolves its runtime strings through
    uiText(locale, key, values, pageMessages) with a page-scoped CONNECTORS_CHOICES
    table; keys the page does not own fall back to the shared SETTINGS_MESSAGES catalog.
    Chinese literals in the connectors code path are gone (799 -> 746 CJK chars in the file,
    the remainder in the zh/en tables and other panels).

Scope boundaries

Evidence bound to this exact head (tree a70e8f45)

  • QA, independent of the new assertions: 240 composioRowState combinations x 6 fields
    byte-identical to base; composioMessage for 8 known codes plus the unknown code identical
    in zh and free of CJK in en; 48 keys produce zero CJK in en; every static zh fragment still
    present in the base source. 2323 assertions, 0 failures.
  • QA, local (not CI): node tests/*.test.mjs plus .github/scripts/*.test.mjs
    1094 pass / 0 fail / 0 cancelled; tests.test_settings_page + tests.test_visible_inventory
    23/23 OK; scripts/visible_inventory.py regenerates visible-controls.json byte for byte
    (sha256 104e84f3a415ec8f192552d451e01abd51a241b4e84356198761c72e78e8defc, 846258 B).
  • QA, tree identity: base rebuilds to 0242db56, head rebuilds to a70e8f45, equal to the
    commit tree fields; the two trees differ only in these 3 paths, no additions or deletions.
  • Lead, local (not CI): the three blobs recomputed from the patch are e928a8f5 (base
    2e6be80e), 70d8296d (base 13e3db62), f99d9fb2 (base 16375bff, already on main).
  • CI on e80b7a15: 18/18 check runs completed, all success.

Risk: risk:T1, applied by the risk gate.

Related #3438

@Birfy
Birfy added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 4445403 Nov 30, 2026
18 checks passed
@Birfy
Birfy deleted the dev/3438-settings-connectors-strings branch November 30, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:T1 Risk tier T1 (client, tests, generated files), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant