Skip to content

docs(automation,opportunities): 补回 zh 两页缺的预测分工段,并按语言包对齐 best_case / closed_amount 词 (#836, #845) - #879

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-836-845-automation-zh-forecast
Aug 6, 2026
Merged

yinlianghui merged 1 commit into
mainfrom
claude/issue-836-845-automation-zh-forecast

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes #836
Fixes #845

两单同落 automation zh 页的「计划类自动化 / 排程類自動化」节(#836 缺段、#845 的错词在同页 flow 表),文件面重叠,按 PM 认领裁定并单一个 PR。仅动文档,src/** 一行未改,en 页零改动。

前提复核

PR 基线 6cd53d2e(含 #854/#864/#870 三轮 automation 页连改与 #842 的 opportunities stage 面)。两单 issue 正文给的行号均已过期,逐条重定位后前提全部成立。

#836:行号下移,段落仍缺

项 issue 说 最新 main 实测 前提
en 第三段 automation.mdx:95 automation.mdx:96 成立,原文一字未变
zh-Hans 该节 两段 :90 起 ## 计划类自动化,段落在 :92 :94,共 2 段 成立
zh-Hant 该节 两段 :90 起 ## 排程類自動化,段落在 :92 :94,共 2 段 成立

## Scheduled automation 一节 en 3 段 / zh-Hans 2 段 / zh-Hant 2 段 —— 缺的正是 #615(66fa27f5)落 forecast_snapshot 时加的那段。#854/#864/#870 动的是 blockquote、操作顺序、监控列表、Email templates 节与 flow 表另两行,与本段无重叠。

#845:行号 :91 → :75,错词仍在

改前跑 issue 给的复核 grep(简繁两侧一并扫):

$ grep -rn "最好情况\|最好情況\|最佳可能\|赢单合计\|贏單合計\|貧單合計" content/docs/
content/docs/sales/opportunities.zh-Hans.mdx:128:| **本季度待成交商机** | 处于**承诺(Commit)**或**最佳可能(Best Case)**、…
content/docs/sales/opportunities.zh-Hans.mdx:134:- **预测类别**——只要**承诺(Commit)**和**最佳可能(Best Case)**。
content/docs/sales/opportunities.zh-Hant.mdx:128:| **本季度待成交商機** | 處於**承諾(Commit)**或**最佳可能(Best Case)**、…
content/docs/sales/opportunities.zh-Hant.mdx:134:- **預測類別**——只要**承諾(Commit)**和**最佳可能(Best Case)**。
content/docs/administration/automation.zh-Hans.mdx:75:| **预测快照** | 计划(每日 3 点) | …—— 管道、最好情况、承诺与赢单合计 |
content/docs/administration/automation.zh-Hant.mdx:75:| **預測快照** | 排程(每日 3 點) | …—— 管道、最好情況、承諾與贏單合計 |
词 issue 给的位置 最新 main 位置 处数 前提
最佳可能 opportunities.zh-Han{s,t}.mdx:128,134 未移动,:128 :134 4 成立
最好情况 / 最好情況 automation.zh-Han{s,t}.mdx:91 下移至 :75 2 成立
赢单合计 / 贏單合計 同上行 同上行 :75 2 成立

zh-Hant 侧词形按实测确认:最好情況、最佳可能(未简化)、贏單合計。issue 复核 grep 里的 貧單合計 是笔误字形,全仓零命中,已在本 PR 的 grep 里一并保留扫过。

事实来源逐条对到包里:

  • src/translations/zh-CN.ts:906 —— crm_opportunity.fields.forecast_category.options:pipeline: '管道', best_case: '最佳情况', commit: '承诺', omitted: '已排除', closed: '已关闭'
  • src/translations/zh-CN.ts:288 —— crm_forecast.closed_amount: { label: '已成交金额' }
  • src/translations/en.ts:306 —— 同字段 en label 是 Closed Won,与 en 页 automation.mdx:75 的 closed-won totals 一致,故 en 页无同族错词,不动

#836 · 译文三段对照

文本
en(automation.mdx:96,未改) The division of labour on forecasts is worth calling out, because it is the pattern to copy: the Forecast Snapshot flow decides who gets a snapshot and what the totals are, while the forecast object's hook decides which calendar period the snapshot belongs to. A cron expression can say "every night"; it cannot say "the first day of this quarter", so that boundary is derived once, by the object, for every writer.
zh-Hans(新增,:96) 预测这一块的分工值得单独点出来,因为它正是要照抄的模式:预测快照 流程决定谁会拿到快照、各项合计是多少,而预测对象的钩子决定这条快照属于哪个日历周期。一条 cron 计划说得出「每晚」,却说不出「本季度的第一天」—— 所以这个周期边界由对象统一推导一次,供每个写入方共用。
zh-Hant(新增,:96) 預測這一塊的分工值得單獨點出來,因為它正是要照抄的模式:預測快照 流程決定誰會拿到快照、各項合計是多少,而預測物件的鉤子決定這筆快照屬於哪個日曆週期。一條 cron 排程說得出「每晚」,卻說不出「本季的第一天」—— 所以這個週期邊界由物件統一推導一次,供每個寫入方共用。

术语与标点全部取自两页自己既有的写法,不新造词:

en zh-Hans zh-Hant 出处
flow 流程 流程 本页通篇
Forecast Snapshot flow 预测快照 流程 預測快照 流程 本页 flow 表 :75 的行名 + 本页 :84 :100 的「粗体流程名 + 空格 + 流程」写法
object hook 对象钩子 物件鉤子 本节上一段 :94
cron expression cron 计划 cron 排程 本节第一段 :92(起始节点带 cron 计划的流程 / 帶 cron 排程的流程)。全仓无「表达式 / 表達式 / 運算式」先例,故不引入新术语,沿用本页已立的机制名
calendar period 日历周期 日曆週期 sales/forecasting.zh-Han{s,t}.mdx:33
writer 写入方 寫入方 sales/forecasting.zh-Han{s,t}.mdx:39
quarter 本季度 本季 各自页内 :75 的既有写法(zh-Hans 作「本季度预测行」,zh-Hant 作「本季預測行」)
一条 / 一筆 快照 这条快照 這筆快照 forecasting.zh-Hans:87 用「一条」,forecasting.zh-Hant:87 用「一筆」

标点同样跟本页:破折号用本节既有的 ——(前后带空格),引号用本页既有的 「」(本页 :41 :82 :84 :92),强调用星号斜体(本页 :67 :98 的 *创建时* *approve* 写法)。

#845 · 逐词改动表

文件 行 前 后 依据
content/docs/sales/opportunities.zh-Hans.mdx 128 最佳可能(Best Case) 最佳情况(Best Case) zh-CN.ts:906 best_case
content/docs/sales/opportunities.zh-Hans.mdx 134 最佳可能(Best Case) 最佳情况(Best Case) 同上
content/docs/sales/opportunities.zh-Hant.mdx 128 最佳可能(Best Case) 最佳情況(Best Case) 同上(繁体字形按 forecasting.zh-Hant:25 等既有「最佳情況」)
content/docs/sales/opportunities.zh-Hant.mdx 134 最佳可能(Best Case) 最佳情況(Best Case) 同上
content/docs/administration/automation.zh-Hans.mdx 75 管道、最好情况、承诺与赢单合计 管道、最佳情况、承诺与已成交金额 zh-CN.ts:906 + zh-CN.ts:288
content/docs/administration/automation.zh-Hant.mdx 75 管道、最好情況、承諾與贏單合計 管道、最佳情況、承諾與已成交金額 同上(繁体字形按 forecasting.zh-Hant:17 既有「最佳情況」「已成交金額」)

共 6 行、8 处词。两页 :128 :134 的「承诺(Commit)」本就写对,未动 —— 同一句里一对一错,现在两个都能在预测类别下拉里找到。

改后同 grep 零命中:

$ grep -rn "最好情况\|最好情況\|最佳可能\|赢单合计\|贏單合計\|貧單合計" content/docs/
$ echo $?
1

「最佳情况 / 最佳情況」的既有正确用例(forecasting、sales/index、glossary、sales-copilot、cubes 共 12 处)不在改动面,一处未碰。

边界

⛔ 未碰 #842 刚落的 stage 词汇面。本 PR 在 opportunities.zh-Han{s,t}.mdx 上只改 forecast_category 的选项名,git diff 显示两页各只有 2 行、共 4 处词变化;成交 / 失败 / 寻找客户 / 资格审查等 stage 词一个未动。⛔ 未碰 automation 页其它节(#854/#864/#870 刚落的内容)—— 两页各只有 1 行 flow 表行 + 1 段新增。⛔ 未动 en 页、src/**、releases/;未加守卫;未升级 @objectstack/*。

段落数欠账复核(#836 顺带项,只报不改)

按裁定复核了 automation 页其余各节是否还有同类欠账(en 多段 zh 少段)。做法:按 ## 标题切节,节内按空行切块,三语逐节比块数,再逐块比行数(后者能抓到表格少行 / 列表少项)。

改前:

   idx | 节 | en | zh-Hans | zh-Hant
   0 | The four kinds        | 1  | 1  | 1
   1 | Validation rules      | 5  | 5  | 5
   2 | Flows (multi-step)    | 11 | 11 | 11
>> 3 | Scheduled automation  | 3  | 2  | 2      ← 本单
   4 | Approvals             | 2  | 2  | 2
   5 | Order of operations   | 4  | 4  | 4
   6 | Email templates       | 3  | 3  | 3
   7 | Where to monitor …    | 1  | 1  | 1
   8 | Tips for admins       | 1  | 1  | 1
   9 | Tips for users        | 2  | 2  | 2

逐块行数:MISMATCH sec 3 "Scheduled automation" block 2: en=1 hans=MISSING hant=MISSING

改后:

   3 | Scheduled automation  | 3  | 3  | 3
逐块行数:clean

结论:这一页没有别的同类欠账。 十个节里只有 Scheduled automation 一处缺段,就是 #836 本身;其余九节段块数与逐块行数三语全等,flow 表 20 行、操作顺序 4 段、Email templates 3 段等均已对齐。#791 同族的其它页不在本单面内,未扫。

验证

worktree /home/user/hotcrm-issue-836,共享锁 flock -w 7200 /tmp/os-heavy-verify.lock + NODE_OPTIONS=--max-old-space-size=4096:

步骤 退出码 关键行
pnpm validate 0 ✓ Validation passed (1486ms) · Data: 17 Objects 344 Fields · Logic: 24 Flows;5 条 ⚠ 均为 main 上既有(approval 空审批人 ×4、campaign_member 字段组 ×1)
pnpm typecheck 0 tsc --noEmit,无输出
pnpm build 0 ✓ Build complete (1625ms) · Artifact: dist/objectstack.json (1921.4 KB)
pnpm test -- --maxWorkers=2 0 Test Files 66 passed (66) · Tests 1587 passed | 1 skipped (1588)
pnpm lint 0 13 warning(s), 14 suggestion(s),全部既有
pnpm hygiene 0 ✓ no raw control bytes in first-party files · ✓ source hygiene clean

test 输出里的 ✗ source hygiene failed: … / ✗ source hygiene: scanned director(y\|ies) missing: … 是 source-hygiene 元测试自己的预期 stderr,不是失败(TEST_EXIT=0)。

automation-docs-coverage 守卫:单跑 + 反向实测

裁定要求单跑一次确认对本改动不敏感。预期方向是「改前改后都绿」(不是改前红)—— 该守卫的派生面是行集 / 触发面 / 数词,与本 PR 动的两处(flow 表描述列的散文、新增的一整段散文)不相交。没有只断言,直接把两个方向都测了:

方向 预期 实测
改后(本 PR 的文本) 20/20 绿 Test Files 1 passed (1) · Tests 20 passed (20)
反向:把四个 doc 文件 stash 回 main 原状(含已知错词的旧文本),同一套规则重跑 仍 20/20 绿 —— 盲区本身 Test Files 1 passed (1) · Tests 20 passed (20)

同一套规则在「写对」和「写错」两份文本上都给绿,所以盲区是测出来的、不是推出来的。成因可从规则本身读出:test/automation-docs-coverage.test.ts:256-271 的两条句子正则锚定的是字面短语(zh-Hans 上表中([一二三四五六七八九十]+)个 计划 行、zh-Hant 上表中([一二三四五六七八九十]+)個 排程 行、表头 **HotCRM 中的内置流程**((\d+) 个)),本 PR 新增的段落不含这些短语,也没有改动任何行标签或触发列。这与 #870 在同一守卫上测到的散文列盲区是同一处,属已知且被接受的状态;本 PR 不加守卫(裁定明确禁止)。

控制字节自扫

对全部 5 个改动文件(4 个 doc + changeset)另做一次超出门禁扫描面的自扫,覆盖 0x00-0x08、0x0b、0x0c、0x0e-0x1f:

$ grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]' [5 个改动文件]
$ echo $?
1        # 无匹配

注:派单提到的 node scripts/check-nul-bytes.mjs 是 framework 仓的脚本名,本仓没有该文件;等价门禁是 pnpm hygiene(scripts/check-source-hygiene.mjs),已单跑并记在上表,其自陈扫描面为 245 files under src, test, e2e, scripts; the control-byte scan adds 397 under content, .changeset,本 PR 的 5 个文件都在其中。如实报此差异。

changeset

.changeset/automation-zh-forecast.md('hotcrm': patch),站内路径一律反引号写(#797),正文按发布说明读者的口径写清「缺了什么判据」与「一个选项三种写法」两件事。


Generated by Claude Code

…ur paragraph in zh and align best_case / closed_amount with the locale pack (#836, #845)

The zh-Hans/zh-Hant `## Scheduled automation` sections carried two of the
English page's three paragraphs. The missing one (#615) is the only place that
gives the criterion for splitting work between a flow and an object hook: the
Forecast Snapshot flow decides who gets a snapshot and what the totals are,
while the forecast object's hook decides which calendar period it belongs to,
because a cron schedule can say "every night" but not "the first day of this
quarter". Both zh pages now carry it, in each page's own vocabulary.

A sweep of the rest of the page found no other paragraph-count gap; every other
section already matches the English page one paragraph for paragraph.

`crm_opportunity.fields.forecast_category.options.best_case` ships as
"最佳情况" in `src/translations/zh-CN.ts`, but the zh docs spelled it three
ways. The two wrong ones are gone: "最佳可能" on the Opportunities pages (four
occurrences, each in the same sentence as an already-correct "承诺(Commit)")
and "最好情况" on the automation pages. The same automation row named the fourth
forecast total "赢单合计", a word the pack ships nowhere; `crm_forecast.closed_amount`
is labelled "已成交金额", which the Forecasting page already used.

Documentation only — nothing under `src/` changed, and the English pages, which
already match the pack, are untouched.

Fixes #836
Fixes #845

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHrPAGEgFDoHjphqYG4BMa
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hotcrm Ignored Ignored Aug 6, 2026 2:34am

Request Review

@yinlianghui
yinlianghui marked this pull request as ready for review August 6, 2026 03:05
@yinlianghui
yinlianghui added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit 716bd4d Aug 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants