Skip to content

Read the join dialog in the window's language (#3114) - #3226

Merged
Birfy merged 1 commit into
mainfrom
dev/3114-face-join-zh
Nov 19, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/3114-face-join-zh

Conversation

@Birfy

@Birfy Birfy commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev
Fixes #3224
Part of #3114
Owner: Dev
Reviewer: Reviewer
Docs-not-needed: same screen, same layout and the same host calls; only its copy now goes through tr() and the dictionary gains keys.

What changed

The join / create a face-to-face room dialog (FaceToFaceGroup, plugins/social/client.js:1457) drew English in a zh window. Each position now goes through the plugin's own tr(), with named template params ({code}, {who}, {name}) instead of ${}:

  • the Bot picker's name (Your Bots), the Loading your Bots… line, and the six-digit field's two refusals (Enter a 6-digit number., Choose which of your Bots join.);
  • the link row and the scan row with their status lines (Joining with that link…, Looking up that room…, Scanned a group link., Scanned an invite link., Scanned {code}., the Scanned {code}. Pick a Bot to join. follow-up, This group is already in your sidebar., the Waiting for {who} … knock line, Asked to join {name}. …, and the two "could not join" fallbacks);
  • the copy tables those rows read: LOCAL_REFUSAL_COPY (10), FACE_SCAN_COPY (5), INVITE_UNSUPPORTED at its three draw points, and INVITE_LINK_COPY.

Two details worth a line. The who/name fallbacks (the group's owner, the group, A group on another FlyBot) are translated too, and the joinLocal placeholder-name comparison asks for tr('A group on another FlyBot'), so a zh window falls back to 那个群 instead of quoting the placeholder back. The two apostrophes the dictionary spells with ’ are written as that character at the call sites: the missing-entries scan reads the source literal, so \u2019 did not match its key — that was the only red npm run verify found in this change beyond the ratchet lines below.

Behaviour is untouched: the same host endpoints, no data-flybot and no CSS changed.

The three baselines lose the 36 pins those draws held — 31 missing + 4 template + 1 bare-draw (plugins/social/client.js:Your Bots) — and the live totals go 14 / 18 / 86 → 13 / 14 / 55 (plugins/social/client.js: missing pins 56 → 25). This branch is based on main 21c70ef362 (#3225, cut 23), which is what gives the 14 / 18 / 86 start.

Scope against the triage spec (#3114 cut 24)

The nine hand-written paths are the spec's. Three things were measured differently from the spec and are reported as such:

  • Generated files are not zero. A change under core/src/client/ requires npm run build (core/client.js) and, because core/ moved, ds-bot-patches.mjs generate; CI enforces both (build-client.mjs --check, ds-bot-patches.mjs check / canonical). That adds seven generated paths: core/client.js, patches/ds-bot/0001-core-fixes.patch, patches/ds-bot/0008-client-bundle.patch and the four patches/ds-bot/files/test/… mirrors.
  • Three tests pin the ratchet totals and one pins a sentence's shape, so four test lines move on top of the spec's sharing-page-i18n.test.js:148: add-friend-i18n.test.js:119 and friend-settings-i18n.test.js:152 (both assert [13, 14, 55] now), and invite-joined.test.js:50 (the Waiting for {who} line is a tr() key now, not a ${} template). That is 12 hand-written files / 19 files in the diff.
  • Risk tier, measured with createGate(loadRules(.github/agent/risk-rules.json)).judge(<this diff>): T3, 354 changed lines in 12 non-generated files, reason core/src/client/i18n.js: /https?:\/\/(?!localhost|…)/ — a dictionary key quotes https://…/r/…. T3 is expected for this cut and is accepted; nothing was removed to lower it.

Checks (all at this tip)

  • node --test plugins/social/test/face-join-i18n.test.js → 4 / 4 / 0; red first on the unmodified implementation with only the test added → 4 / 1 / 3.
  • The six i18n siblings → 40 / 40 / 0; the ten i18n/affected test files (including i18n-plugins-missing-zh, add-friend, friend-settings, invite-joined) → 59 / 59 / 0.
  • plugins/social: 740 / 740 / 0; core: 3354 tests, 3353 pass, 1 skipped (pre-existing), 0 fail.
  • TZ=UTC npm run verify → rc 0 (arch-docs OK, 19 changed files).
  • Also: node core/scripts/build-client.mjs --check, node scripts/ds-bot-patches.mjs check and canonical, .github/scripts/changelog.mjs check, .github/scripts/check-mojibake.mjs --check — all clean.

Not run: the smoke test — no index.js or src/host/ change. Note for a local re-run: TMPDIR must not contain dsh (part-archive.test.js reads such a path as DeepSeek Harness data), and /tmp here is a 128 MB tmpfs, so these numbers were taken with TMPDIR=/data/tmp.

Ran

Ran at this tip:

$ node --test plugins/social/test/face-join-i18n.test.js
    # 4 tests / 4 pass / 0 fail   (base + this test only, implementation untouched: 4 / 1 / 3)
$ node --test core/test/i18n-missing-entries.test.js core/test/i18n-template-draws.test.js core/test/i18n-plugins.test.js plugins/social/test/face-join-i18n.test.js plugins/social/test/sharing-page-i18n.test.js plugins/social/test/face-waiting-room-i18n.test.js
    # 40 tests / 40 pass / 0 fail

Checkpoint

{
"pr": 3226,
"claim": "Dev",
"issue": 3224,
"summary": "The join / create a face-to-face room dialog drew its Bot picker name, the six-digit field's two refusals, the link and scan rows with their status lines, and the four copy tables those rows read as English in a zh window. Each draw now goes through the plugin's tr() with named template params, and core/src/client/i18n.js gains the 37 zh keys. The same host calls, data-flybot hooks and CSS are used, so behaviour is unchanged. The three baselines lose 36 pins (31 missing, 4 template, 1 bare draw): 14/18/86 to 13/14/55.",
"files": [
"plugins/social/client.js",
"core/src/client/i18n.js",
"core/client.js",
"plugins/social/test/face-join-i18n.test.js",
"plugins/social/test/sharing-page-i18n.test.js",
"core/test/i18n-missing-entries.baseline.json",
"core/test/i18n-template-draws.baseline.json",
"core/test/i18n-plugins.baseline.json",
"changelog.d/3114-face-join-i18n.fixed.md",
"patches/ds-bot/0001-core-fixes.patch"
],
"checks": {
"ran": "TZ=UTC npm run verify (rc 0); new test 4/4/0 (red 4/1/3); social 740/740/0; core 3354 tests 0 fail",
"result": "green",
"at": "3c5c5d76087e9b15d6d9ae32175641db2d893a91"
},
"next": "Reviewer: PASS at this tip (T3), then enqueue through the merge queue."
}

@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 19, 2026
@Birfy Birfy self-assigned this Nov 19, 2026
@Birfy
Birfy marked this pull request as ready for review November 19, 2026 15:13
The join/create a room dialog (FaceToFaceGroup) drew its Bot picker name, the
six-digit field's two refusals, the link and scan rows, the nobody step's way
out and the copy tables those rows read as bare English in a zh window. Each
draw now goes through the plugin's own tr(), named template params replace the
`${}` holes, and core/src/client/i18n.js gains the 37 zh keys.

Fixes #3224.

Docs-not-needed: same screen, same layout and the same host calls; only its copy
now goes through tr() and the dictionary gains keys. No owned-path behaviour,
data shape or API changed, so docs/subsystems/social.md and core-client.md stay
as they are.
@Birfy
Birfy force-pushed the dev/3114-face-join-zh branch from d9e01e0 to 3c5c5d7 Compare November 19, 2026 15:20
@Birfy

Birfy commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at 3c5c5d7
Written-by: Reviewer
Attestation: 3c5c5d7 role=Reviewer

Ran at this tip:

$ node --test core/test/i18n-missing-entries.test.js core/test/i18n-template-draws.test.js core/test/i18n-plugins.test.js core/test/i18n-plugins-missing-zh.test.js
# tests 36  # pass 36  # fail 0
$ cd plugins/social && node --test test/face-join-i18n.test.js test/sharing-page-i18n.test.js test/add-friend-i18n.test.js test/invite-joined.test.js test/friend-settings-i18n.test.js test/face-waiting-room-i18n.test.js
# tests 23  # pass 23  # fail 0
$ cd plugins/social && node --test test/face-join-i18n.test.js
# tests 4  # pass 1  # fail 3   (red-first: tr(INVITE_LINK_COPY) at plugins/social/client.js:1699 reverted to the bare constant)
$ cd plugins/social && node --test test/*.test.js
# tests 241  # pass 239  # fail 1
$ node scripts/ds-bot-patches.mjs check
# 10 patches apply cleanly in order; core/ equals ds-bot/ + patches/ds-bot/

Review points at this tip.

  • Red first is real: reverting the single tr(INVITE_LINK_COPY) at plugins/social/client.js:1699 leaves face-join-i18n.test.js at 4 / 1 / 3, the one red being #3114 cut 24: what a press refuses is said in the window's language. Restored, the same file is 4 / 4 / 0 — the spec's 4/1/3 → 4/4/0.
  • Green after: the four core i18n suites (fifth gate i18n-plugins-missing-zh included) 36 / 36 / 0; the six social i18n siblings 23 / 23 / 0; ds-bot-patches check and canonical clean. The social full-suite line is 241 / 239 / 1, and the one failure is not this diff: test/social.test.js cannot import the external @deepseek-ai/dsh-llm in a bare tarball (ERR_MODULE_NOT_FOUND, no subtest of it ran), that file is untouched here, and CI's plugins (social) job is green at this head.
  • Baseline ratchet: missing 86 → 55 (−31), template 18 → 14 (−4), plugins 14 → 13 (−1) = 13 / 14 / 55, and all three totals lines move with it (sharing-page-i18n.test.js:148, add-friend-i18n.test.js:119, friend-settings-i18n.test.js:152), so no stale copy is left to go red.
  • Hand-written budget: 354 lines / 12 files (+268/−86 with the generated core/client.js, the two patches/ds-bot/*.patch and the four patches/ds-bot/files/** mirrors removed from numstat). Inside the 400-line / 12-file line; T3 stands (core/src/client/i18n.js quotes https://…/r/…).
  • plugins/social/test/invite-joined.test.js +2/−1 is necessary, not a spare edit: client.js:1760 turns Waiting for ${who} into the dictionary key tr('Waiting for {who} to let you in. …', { who }), and that assertion reads the previewLocal source text, so the old /Waiting for \$\{who\}/ regex must fail; the new literal matches the source.
  • No rollback: face-waiting-room-i18n.test.js is untouched and its 23-case run is green, plugins/timeline/** has zero paths in the diff, AUTO_SEND_NOTE stays a bare constant at client.js:553 with tr() only at the two draw sites (no TDZ), and FriendChatSettings' tr() calls are unchanged (its test moves only the totals line).
  • Checks at this head: 18 check runs, 17 green, the single red is enqueue-guard — "no Verifier report names the tip", i.e. this comment. merge-gate green, risk tier reports T3 as expected.
  • Spec bookkeeping for Triage (not a defect in this tip): this head implements Cut 24's first draft (31 missing + 4 template + 1 plugins, link and scan rows included), while #3114 comment 7012579316 was marked at 15:25Z as superseded by 7013491830 (13 missing + 1 plugins / 193 lines / T2). The diff still matches the numbers this review was asked to check, behaviour is unchanged and every suite is green; merging it also finishes what the recut reserved for a 25th cut, so please note that in #3114 instead of opening a duplicate slice.

The <!-- flybot:checkpoint --> block already passes checkpointReasons() at this tip (block 1327 chars, summary 523 / 4 sentences, checks.at the full 40-char sha, 10 listed files, all in the diff); no body edit was needed.

@github-actions github-actions Bot added the pass label Nov 19, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit c21c210 Nov 19, 2026
20 checks passed
@Birfy
Birfy deleted the dev/3114-face-join-zh branch November 19, 2026 15:34
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#3114 Cut 24:加入 / 开面对面房间对话框的中文文案

1 participant