Repository navigation
Read the room-invite preview card's lead, people and countdown in the window's language (#3114) - #3250
Conversation
The card pasted into the face-to-face panel drew every word in English. Its lead line, people line, countdown, two clock answers, Clear button and the nameless fallback now come from the client dictionary, and the counts travel beside the English sentence so a stored preview stays untranslated and a language switch is honoured at draw time. Docs-not-needed: a dictionary entry plus five draw points in one component, no architecture change.
|
Verdict: PASS at 34a7ca9 Ran at this tip: Red first, taken on this tip's tree with only the two changed sources put back to base Points checked:
Scope matches the PR body: 9 files, No changes requested; nothing to fix. Enqueuing. |
Fixes #3249
Part of #3114
Written-by: Dev
Owner: Dev
Reviewer: Reviewer
Tier: T1 (computed by
risk-gateover these 9 paths:why [],lines 118 files 4 generated 5; norisk:T*label written)Base: faf7792
Docs-not-needed: a dictionary entry plus five draw points in one component, no architecture change.
What changed
The card drawn under the face-to-face panel's
Group invite linkbox was English down to its last word in a zh window:Lead: Chief,3 / 8 in the room,1:05 left to join, theClearbutton, and — when the card has nothing else to show —Face-to-face room,Open while the room is openandThis link has expired. All seven draw points incore/src/client/room-invite-preview.jsnow go throught(), and the dictionary gains five entries:Lead: {lead},{members} in the room,{members} / {max} in the room,This link has expired,Open while the room is open. The four sentences the dictionary already had —{time} left to join,Face-to-face room,Join,Clear— are reused, not duplicated.The people line is built at draw time, not in the preview object:
invitePreviewOfnow also returns themembers/maxMembersnumbers (nullwhen the server sent none), andpeoplekeeps exactly today's English sentence. The plugin stores the whole preview in itsinvitestate (plugins/social/client.js:1728), so a sentence translated there would freeze at the language that was active when the reply arrived; a card already on screen now follows a language switch, and the English window is byte-for-byte what it was.This link has expiredis deliberately its own key: the dictionary'sThis link has expired.carries a full stop the card never drew, so borrowing it would have changed the English sentence.Before / after at this tip (zh window, one card):
Lead: Chief→总负责人:Chief;3 / 8 in the room→房间里 3 / 8 人;1:05 left to join→还剩 1:05 可加入; footClear/Join→清空/加入; nameless cardFace-to-face room→面对面房间;Open while the room is open→房间开着的时候都能加入;This link has expired→这条链接已过期. The room name, the member counts and them:ssdigits come from the server and are copied through untouched.Bundle lane:
core/client.jsand the fivepatches/ds-bot/paths are generated (npm run buildincore/, thennode scripts/ds-bot-patches.mjs generate, twice, thencanonical); nothing underpatches/was hand-edited andpatches/ds-bot/topics.jsondid not move (the two upstream files this cut edits arei18n.jsand the already-registered test).Red first (only the test added, sources untouched)
$ cd core && TZ=UTC node --test test/room-invite-preview.test.jsThe four new cases live in the existing
core/test/room-invite-preview.test.js(89 → 153 lines, 5 → 9 examples); the five#876cases are untouched, and they still pin the English sentences word for word.Verification at the tip
Tip SHA:
34a7ca906f256e5b2ce3da47cd2fe294f349156b(treeb2fef6647cae3ae12638b52d8665284d156072bc; the local commitc86cdc0adaaa4ae6a9cb21794aa52e9f850f5421has the same tree, and every reading below ran on it).Ran:
# tests 9 / # pass 9 / # fail 0; the five#876examples still green with their English assertionscore/test/i18n.test.js(the "every literal the client translates has a Chinese entry" gate) →# tests 3 / # pass 3 / # fail 0npm testincore/,DSH_HARNESSpointed at an installed harness) →# tests 3380 / # pass 3379 / # fail 0 / # skipped 1(the pre-existing skip)plugins/socialsuite (npm testthere, same harness) →# tests 758 / # pass 758 / # fail 0— the 16face-link-previewEnglish assertions still hold, which is the second lock on "the English card did not change"node core/scripts/build-client.mjs --check→ 0;git diff --exit-code -- core/client.js→ 0node scripts/ds-bot-patches.mjs check→ 0, three lines:ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5),10 patches apply cleanly in order,core/ equals ds-bot/ + patches/ds-bot/; a realgeneratewas then a no-op andcanonicalprintedok patches/ds-bot/ is what generate writes (generate is a no-op)npm --prefix core run lint→91 warnings and 0 errors;ARCH_DOCS_BASE=<base> npm --prefix core run arch-docs→arch-docs: OK (9 changed file(s))(the commit and this body each carry theDocs-not-needed:line)node .github/scripts/changelog.mjs check→ 0,changelog: 11 fragment(s) in changelog.d/ are well formednode .github/scripts/check-mojibake.mjs --check→ 0,ok — 0 occurrences of U+FFFD in 1777 text file(s)12 / 9 / 46;grep -rl "[12, 9, 46]" plugins/social/test/*.js | wc -l→ 6git diff --name-only <base>...HEAD | grep -c '^plugins/'→ 0;grep -c face-link-preview plugins/social/test/social.test.js→ 42, the same count as on the basegit diff --numstat <base>...HEADover the hand-written paths →118 4(T1 limit 400 lines / 20 files);risk-gate→tier T1 | why [] | lines 118 files 4 generated 5Not run (and why):
npm run verifyat the repo root: the root has nopackage-lock.jsonin the tree, sonpm cirefuses (can only install with an existing package-lock.json), and the root includes the other plugin suites and the interop/live-e2e suites. This diff touches no file outsidecore/src/client/**,core/test/**, the generated bundle/patches and one changelog fragment, so I ran the affected suites and the gates above instead.plane,plugins/{tree,timeline,workflow,project}and the.github/policy/interop suites were not run; none of their files changed.Checkpoint
{ "pr": 3250, "claim": "Dev", "issue": 3249, "summary": "The face-to-face room's pasted-invite preview card still spoke English in a zh window across all seven of its draw points. They now go through the client dictionary, with five new entries and four reused ones. The people line is built when the card is drawn from the member counts, so the preview a plugin stores keeps its English sentence and a card already on screen follows a language switch. The English card is unchanged, which the five older unit examples and the plugin's own assertions both pin.", "files": [ "core/src/client/room-invite-preview.js", "core/src/client/i18n.js", "core/test/room-invite-preview.test.js", "core/client.js", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0008-client-bundle.patch", "patches/ds-bot/files/src/client/room-invite-preview.js", "patches/ds-bot/files/test/room-invite-preview.test.js", "changelog.d/3114-room-invite-card-zh.fixed.md" ], "checks": { "ran": "room-invite-preview 9/9, i18n 3/3, full core suite 3380, plugins/social 758, build-client --check, ds-bot-patches generate/check/canonical, core lint + arch-docs, changelog check, mojibake check", "result": "green", "at": "34a7ca906f256e5b2ce3da47cd2fe294f349156b" }, "next": "none — ready for review" }