Repository navigation
[PR] fix(web): pack-editor i18n — {need} placeholder + scannable key refs (#1024) - #5366
Merged
Merged
Conversation
…ption keys visible to the #1024 dead-key guard The guided pack editor (#5345) broke the i18n parity tests on master push CI: 1) en cfg.q_pack_ai_p1 was missing the {need} placeholder its zh twin has (client.ts interpolates t("cfg.q_pack_ai_p1", { need })). 2) Four catalog keys were passed as bare strings through helper parameters (option array / packSectionField), which the #1024 reference scanner (literal t(\"key\") only) cannot see — flagged as dead keys. Labels are now translated at the call sites so every key has a scannable literal reference. Verified locally at origin/master (44fcbe4): tests/web-i18n.test.ts + web-user-packs.test.ts 11/11 (was 9/11); all web/pack/i18n suites 257/257; tsc --noEmit clean.
Contributor
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7559-pr.5366.37247faThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5366.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.968-master.a2388eb # this exact build
npm install -g billion-context@master # always the newest merged build
|
Louie0806
added a commit
to Louie0806/billion-context
that referenced
this pull request
Oct 31, 2026
…fix instead of widening the gate Upstream shipped the same two master-reds I had just fixed my own way, in a2388eb / ranxianglei#5366 (`fix(web): pack-editor i18n — {need} placeholder + scannable key refs (ranxianglei#1024)`). Their approach is strictly better than mine and supersedes it, so this merge takes theirs in both places: - src/web/i18n.ts: they restore `{need}` with a slightly fuller sentence ("My scenario and requirements are as follows: {need}") — taken verbatim. - tests/web-i18n.test.ts: they keep the dead-key gate EXACTLY as strict as it was and move the burden to the call sites — `packSectionField(t("…"), t("…"))` and `[["", t("cfg.q_pack_base_blank")], …]` become literal `t("…")` calls (src/web/client.ts). My version had widened `collectRefs()` to accept any `cfg.*` literal, which would have let a future dead key slip through if it appeared in any web source for an unrelated reason. Their fix keeps the gate able to catch that, so my test edit is reverted to master's file verbatim (`git diff upstream/master -- tests/web-i18n.test.ts` is empty). Net effect: this lane no longer carries an i18n change at all. The sixth master-red is fixed upstream, not by me, and the branch diff vs master is back to 14 files / +1244 / -45 — the two thinking-leak lemmas, their tests, and the config-docs seed they need to keep docs-sync a fixed point. Verified on the merged tree: web-i18n 10/0 (master's original strict gate), gen-config-docs fixed point, tsc clean.
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
来源: #5341 回归评审(v0.1.209 → master)期间发现的 master CI 红(#1024 i18n 守卫),根因在 #5345 pack editor 的 i18n 内容。
问题
master push(44fcbe4)与 #5341 车分支的 test 矩阵各挂 2-4 job,失败全部集中在
#1024守卫:catalog parity— placeholder mismatch for "cfg.q_pack_ai_p1"(en 串漏{need},zh 孪生串有,client.ts 运行时以t("cfg.q_pack_ai_p1", { need })传参);no dead keys— 底本下拉 4 键 + packSectionField 的 label/help 共 8 键经数组/helper 参数间接引用,Web UI 英文翻译开关(i18n)— 社区 PR #807 (@amirzamli) #1024 扫描器只认字面量t("key")⇒ 逐个报死键。修复(owner 备好的 commit 7fad432a,本分支原样应用)
cfg.q_pack_ai_p1末尾补: {need},与中文占位符集合一致;t(...)、helper 收现成字符串——行为零变化,只让每个键有扫描器可见的字面引用。验证(本地,origin/master 44fcbe4 + 本提交)
tests/web-i18n.test.ts+tests/web-user-packs.test.ts:11/11(owner 报告修前 9/11);合入后 master push CI 与 #5341 车分支的
#1024失败项转绿。