Skip to content

Social 两张通知卡(分享请求 / 已接受邀请)在中文窗口里仍是硬编码英文 #3209

Closed

Description

@Birfy

Written-by: Triage

Part of #3114

缺什么

窗口语言是中文时,Social 面板的两张通知卡仍是硬编码英文(main c0061ba018d40267d86050e0fdc59e2aea4761ff,plugins/social/client.js):

  • acceptNoticeSentence::3315 'A friend'、:3316 'your Bot'、:3317 {who} accepted your invite. They can message {bot}. You cannot message them until they share a Bot with you.
  • AcceptNotices::3324 'You asked them to share a Bot.'、:3327 'Dismiss'、:3334 'Ask them to share a Bot'
  • ShareRequests::3345 'your Bot'、:3347 {who} tried to start a chat with ${bot}. ${bot} is not shared with them.、:3350 'Dismiss'、:3355 title: Open ${bot}'s Sharing、:3358 Share ${bot}…

用户看到的结果:分享请求卡读 Helper (Eve) tried to start a chat with Writer. Writer is not shared with them.、按钮 Dismiss / Share Writer…;已接受邀请卡读 Chief Grant (SelfB1025) accepted your invite. …、按钮 Dismiss / Ask them to share a Bot。同一面板其余 chrome 已是中文,只有这两张卡英文。

依据(上一版写错过,已更正):不是父单缺句。#3110 L93 的「已补中文文案(如「{name} 请求分享」)」说的是 grant_request 卡,那张卡属 #3112(它在 core/src/client/i18n.js 的 'Friend requests' 之后新增 'A friend' 与 '{name} requests a share');main 上 grep -rn "请求分享" 0 命中、grep -rn "requests a share" 0 命中,只证明 #3112 没合。#3110 全文 grep -n "接受邀请\|分享请求" 0 命中;L205/L207 的「人话」指不露内部错误码,这两张卡已是人话英文,不构成中文要求。

本单的依据是仓库自己的 i18n ratchet + 可复现的混语缺陷:

  • core/test/i18n-missing-entries.test.js:1-24:a value with no zh key cannot be translated — it is the gap;基线 may only shrink、each leaves the baseline when its zh entry lands — never by editing the baseline。core/test/i18n-plugins.test.js:1-16、core/test/i18n-template-draws.test.js:1-8 是同一笔账的另两个视角。
  • main 上三条基线逐条钉着这批英文:i18n-plugins 的 Dismiss#1/Dismiss#2、i18n-template-draws 的 2 条插值 draw、i18n-missing-entries 的 3 条无 zh 键句子。

要做的

把这两张卡(AcceptNotices / ShareRequests)的句子、提示行、按钮文字与 title 全部改走 tr()(plugins/social/client.js:1018,走 globalThis.__flybot__.t,不是函数时回落英文),并在 core/src/client/i18n.js 补 7 个中文键(Dismiss、your Bot 已有):

  1. 中文窗口:两句整句、You asked them to share a Bot.、Ask them to share a Bot、Dismiss、Open {bot}'s Sharing 的 title、Share {bot}… 全部显示中文。
  2. 没有 translator 的窗口:逐字保持今天的英文,一个字符不变。
  3. 含 {name} / {bot} 的句子必须走 tr(key, params),不能再写成 ${} 模板串——否则三条基线不会缩短,反而新增一条带插值的 draw。
  4. 三条基线里对应的 8 条英文随之删净(Dismiss#1/#2、2 条模板 draw、3 条无 zh 键句子),计数 19→17、40→37、158→155;只删不增。
  5. client.js 一共改 11 行(3315/3316/3317/3324/3327/3334/3345/3347/3350/3355/3358),别把「8 条基线」和「11 行代码」混成一个数。

不做什么

  • 不改 host 侧 plugins/social/src/**(T3)、不动 core/src/shared/**、authz.js、policy、ruleset、DSH。
  • 不做 grant_request 卡片的展示与审批:main 的 plugins/social/src/social.js:3712 只放行 outbound_message / face_room_message,真 grant_request 到不了客户端,补它必须改 host(T3),不在本单。
  • 不改 #3112(open、dirty、194 文件、tip 上 tests-ok 红)里的 GrantRequests 卡与 grantRequestSentence:它只撞插入点(ShareRequests 之后),不撞本单这 11 行。
  • 不重切已落三刀:#3204(手动未读清除时机)、#3206(行菜单 + 顶栏清除入口)、#3208(定时任务表单时区)。
  • 不做「开着就点亮未读点」(#3110 L102 没有这句要求,且 core/src/client/sidebar.js 6 处 !active 守卫要同时对齐)。
  • 不碰 FlyBot Lead 线(#3192 #3194 #3197 #3198 #3203、PR #3193 #3195 #3200 #3201)与签名墙 7 张 PR。
  • 不做用户浏览器界面验收,不跑发布。

验收

以 #3114 第十八刀规格(Cut 18)的 A1–A14 为准:A1 是只加测试时的 # tests 3 / # pass 0 / # fail 3(三条失败文案见规格 §4),A2 是实现后的 3 / 3 / 0,A3 是 core i18n 五件套 39 / 39 / 0,A4 是三条 grep 都输出 0,A5 是三条基线 0/2、0/3、0/3 只删不增,A6 是计数 17 / 37 / 155,A7 是 ok 9 strings,A8 是无 translator 1 / 1 / 0,A9 是 social.test.js 的 500 / 500 / 0 与 social-readonly.test.js + face-chip-i18n.test.js 的 20 / 20 / 0(两条命令两个数),A10/A11 是 ds-bot-patches 的 generate → check → canonical(ok 后三个空格)与 git ls-files core/node_modules 为空,A12 是手写 +201 / −19(7 文件含 changelog、220 行 ≤ T2 的 250 行 / 12 文件),A13 是改动范围恰好 13 个路径(手写 7 + 生成物 6),A14 是 changelog 片段与 Fixes #3209 / Fixes #3114 = 0 的接线。

关联

  • 规格评论:#3114 #issuecomment-7002251940(《第十八刀切片规格(Cut 18)》,唯一一条定稿)
  • 与 #3112 的重叠(先后顺序写在规格 §11):
    • plugins/social/client.js:它只插 GrantRequests / grantRequestSentence / grantRequests state(@@ -3230、@@ -3275、@@ -3331),本单改 3315–3358 的 11 行,无一行重合;后合方保留对方的卡与函数,两边都不新增 import。
    • core/src/client/i18n.js:双方都加 'A friend': '一位好友'(本单在 'FlyBot core' 之后,#3112 在 'Friend requests' 之后)。后合的一方删掉自己那份;若 #3112 先合,本单不写这条,A7 仍 ok 9 strings,A12 变 +200 / −19(219 行)。
    • 后合方 rebase 完必须先 (cd core && node scripts/build-client.mjs)、再 git add -A → git rm --cached core/node_modules → generate → check → canonical;只跑 generate 会让 core/client.js 缺对方 i18n 改动,npm run verify 的 build-client --check 会红。0001-core-fixes.patch / 0008-client-bundle.patch 不许手合并。
  • 实现 PR 写 Fixes #<本单号> + Part of #3114,绝不写 Fixes #3114。

Activity

  1. added
    bugSomething isn't working
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:socialFriends, invites, grants, Bot Social
    area:uiWeb/desktop UI and copy
    on Nov 19, 2026
  2. Birfy commented on Nov 19, 2026

    @Birfy
    CollaboratorAuthor

    Claim

    Written-by: Dev
    Claim-Id: 1925a56c508474ccd92d95655ca288ef
    Branch: dev/3114-social-share-cards-zh
    Base: c0061ba
    At: 2026-11-19T07:26:30Z

  3. self-assigned this
    on Nov 19, 2026
  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 19, 2026
  5. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:socialFriends, invites, grants, Bot Socialarea:uiWeb/desktop UI and copybugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions