Skip to content

settings: mark the media, skill-key and channel panels for translation - #3478

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

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

Conversation

@Birfy

@Birfy Birfy commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

The runtime slice (#3477) covered the strings Settings builds in JavaScript. The
markup still carried 45 Chinese lines: the image, video, music and 3D model API
forms, the skill-key page, the external channel links, and two rail controls
(appearance-toggle's label and account-menu-button's aria-label). An
English /settings rendered all of them in Chinese because those texts had no
data-ui-* marker for renderSystemLocale to replace.

This slice only adds markers and catalog pairs; it does not move text around:

  • 45 markers on 43 controls/phrases in settings/index.html. Label text that
    sits next to an <input> moves into a <span data-ui-text=...> (the pattern
    the file already uses 19 times), because the leaf replacement only rewrites an
    element whose content is plain text.
  • 45 zh/en pairs in shell/system-locale-catalog.mjs under
    settings.image-api.*, settings.video-api.*, settings.music-api.*,
    settings.model3d-api.*, settings.skills-secrets.* and
    settings.channels.*. settings.back and settings.channels.help are reused
    instead of duplicated.
  • The two catalog strings the page already ships are reused for the rail
    controls: data-ui-label="shell.account.menu" and
    data-ui-text="settings.appearance.light".

appearance-toggle's Chinese text is the pre-hydration placeholder:
bindAppearanceToggle replaces the button's content with
<span data-appearance-label> and syncAppearanceButton fills it, so the
new marker changes the server-rendered bytes (the acceptance surface) and
not the post-hydration label.

The language picker names (简体中文, 繁體中文, 繁體中文(香港),
繁體中文(台灣), 日本語) stay in their native script on purpose: they are the
option labels a user picks a language by, so a reader who cannot read the
current UI language can still find their own. The slice test pins that set at
seven <option> rows and fails if any other Chinese phrase survives, so the
intentional ones cannot hide a missed marker.

Verification (local, non-CI, on tree 809dc4a30b6cb4307f3b5892f5c8032ab89ab908,
patched from main 0b069b37 / content tree a6815204):

  • English /settings render through the shipped path
    (createPageHandler + renderSystemLocale): Chinese lines 52 -> 7, and
    all 7 are the language picker names listed above; the 45 marked lines are
    gone. No unmarked Chinese remains.
  • Chinese /settings render: visible text per line is identical to the base
    (0 differing lines after normalizing tags and the asset-hash URLs), 283
    Chinese lines before and after.
  • node --test --test-concurrency=2 tests/*.test.mjs .github/scripts/*.test.mjs manager/compose-planner/compose-command-planner.test.js -> 1124 pass /
    0 fail / 0 cancelled
    (the CI input of 1122 cases plus the two new cases).
  • tests.test_settings_page + tests.test_visible_inventory -> 23/23 OK.
  • scripts/visible_inventory.py regenerated: only the data field of 19
    controls changes, no line numbers move, and a second run is byte-identical.
  • Two new cases in tests/system_locale_settings.test.mjs: one asserts the
    English render leaves no Chinese outside the seven language-name options and
    that the former leftovers are really translated in the response bytes, the
    other asserts the Chinese render keeps every phrase the new markers wrap.

No CI run exists for this slice yet.

Related #3438

The runtime slice (#3477) covered the strings Settings builds in JavaScript;
the markup still carried 45 Chinese lines with no `data-ui-*` marker, so an
English `/settings` rendered them in Chinese. This adds the markers and the
catalog pairs and changes no wording: 45 markers on 43 controls in
`settings/index.html` (label text next to an `<input>` moves into a
`<span data-ui-text=...>`, the pattern the file already uses 19 times, because
the leaf replacement only rewrites an element whose content is plain text),
45 zh/en pairs in `shell/system-locale-catalog.mjs`, the regenerated
`docs/inventory/visible-controls.json`, and two cases in
`tests/system_locale_settings.test.mjs`.

The language-picker names stay in their native script on purpose and the new
test pins that set at seven `<option>` rows, so an intentional survivor cannot
hide a missed marker.

Related #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 — head ff3d7b0a07298c851e37b2aa5c1438b408ddd4fe

Scope: one reviewable slice for the /settings page tracked in #3438. 4 files, +160/-64, base main @ 0b069b37.

  • settings/index.html — 45 placements (43 text leaves, plus the account-menu-button aria-label and the appearance-toggle light/dark labels). Labels that wrap an <input> were moved into <span data-ui-text=...> following the 19 existing occurrences in the file, because leaf replacement only matches plain text nodes.
  • system-locale-catalog.mjs — 45 zh/en pairs in the file's existing single-quote style.
  • docs/inventory/visible-controls.json — regenerated with the in-tree generator.
  • tests/system_locale_settings.test.mjs — 2 new cases (line 77 and line 113).

Evidence, all bound to the head above (tree 809dc4a3, 2229 entries, single parent 0b069b37, blobs 17b4bd95 / 0c5f2f83 / ee4ac0a1 / c089d5f4, numstat +19/-19, +45/-45, +45/-0, +51/-0):

  • en gate through the shipped path renderSystemLocale(html,'en',undefined): source 88534 B -> en 89356 B, sha256 39d39e5f619e1a0ca213254d31e2b2b992675fe09d1a556e71a0838f522eed17, 0 leaked lines, exactly 7 remaining lines and all of them <option> language names (the native names are kept on purpose, two selectors).
  • zh side: 417 text nodes and the aria-label / title / placeholder / alt sequences are identical to baseline, textDiff 0 / attrDiff 0; the 7 language names are unchanged.
  • client guard: 198 data-ui-* markers, catalog zh value equals the current text or attribute in every case (0 failures), no empty en values and none equal to zh.
  • inventory: 1919 entries, line shift 0, only 19 data fields changed, regeneration idempotent.
  • Local suites (not CI): node 1124/1124 pass, python 23/23.

CI on this head: 18/18 success, including runtime-image / Build and smoke under the manager contract and FlyBot required checks.

Trailer is Related #3438 only; no closing keywords. risk:T1, mergeable clean. Entering the merge queue.

@Birfy
Birfy added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 1f2cf1b Nov 30, 2026
18 checks passed
@Birfy
Birfy deleted the dev/3438-settings-html-strings branch November 30, 2026 15:26
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