Skip to content

fix(marketing): refuse a campaign that is not open in one sentence per locale at every door (#2778) - #2779

Merged
sunhaolin merged 1 commit into
mainfrom
claude/gifted-zhukovsky-6b6e95
Nov 25, 2026
Merged

sunhaolin merged 1 commit into
mainfrom
claude/gifted-zhukovsky-6b6e95

Conversation

@sunhaolin

Copy link
Copy Markdown
Collaborator

Description

Fixes #2778

A campaign that is not open for enrollment was refused in two different sentences in zh-CN and ja-JP, depending on which door refused: the campaign_member_enrollment_gate hook (New on a campaign's member list, import, REST) said one thing, the Add to Campaign flows and the Enroll Members flow said another. English and es-ES already read as one sentence. This makes the flow rows carry the hook row's sentence in both locales and pins the three rows together with a test.

Metadata-impact: reviewer

Translations, one line of the Chinese in-app manual, a test and a changeset. No flow, hook or object behaviour changes, and no English string changes.

Before and after

zh-CN

Door Row Before After
New / import / REST hooks.campaign_member_enrollment_gate.refusals.VALIDATION_FAILED.reasons.named {{campaign}}未开放报名,或已不存在:只有“规划中”或“进行中”的营销活动可以加入成员。没有人被加入。 unchanged (the reference)
Add to Campaign flows.campaign_lead_member_enroll / campaign_contact_member_enroll .refusals.refuse_campaign_not_open {{ campaignRecord.name | default: "所选营销活动" }} 不在可加入成员的状态,或已不存在:只有处于「规划中」或「进行中」的营销活动可以加入成员。没有任何人被加入。 {{ campaignRecord.name | default: "所选营销活动" }}未开放报名,或已不存在:只有“规划中”或“进行中”的营销活动可以加入成员。没有人被加入。
Enroll Members flows.campaign_enrollment.refusals.refuse_not_open 该营销活动不在可加入成员的状态,或已不存在:只有处于「规划中」或「进行中」的营销活动可以加入成员。没有任何人被加入。 这个营销活动未开放报名,或已不存在:只有“规划中”或“进行中”的营销活动可以加入成员。没有人被加入。

ja-JP

Door Before After
New / import / REST (hook, named) {{campaign}}は参加受付中ではないか、すでに存在しません。メンバーを追加できるのは「計画中」または「実施中」のキャンペーンだけです。誰も追加されていません。 unchanged (the reference)
Add to Campaign (both flows) {{ campaignRecord.name | default: "選択したキャンペーン" }} はメンバー登録を受け付けていないか、すでに存在しません。メンバーを登録できるのは「計画中」または「実施中」のキャンペーンだけです。誰も登録されていません。 {{ campaignRecord.name | default: "選択したキャンペーン" }}は参加受付中ではないか、すでに存在しません。メンバーを追加できるのは「計画中」または「実施中」のキャンペーンだけです。誰も追加されていません。
Enroll Members このキャンペーンはメンバー登録を受け付けていないか、すでに存在しません。メンバーを登録できるのは「計画中」または「実施中」のキャンペーンだけです。誰も登録されていません。 このキャンペーンは参加受付中ではないか、すでに存在しません。メンバーを追加できるのは「計画中」または「実施中」のキャンペーンだけです。誰も追加されていません。

es-ES and English: already one sentence at all three doors; not touched.

Choices worth a reviewer's eye

  • The hook row is the sentence the flows adopt, not the other way round: it is the one the direct door has shown since Campaign members created directly (panel New, import, REST) skip the closed-campaign and email-opt-out gates that Add to Campaign and Enroll Members now apply #2344, it has no space after the campaign's name, and it quotes the two statuses with “ ”, as the other hook refusals in this pack do (campaign_validation says “进行中”).
  • Enroll Members keeps its own subject because the flow runs on one campaign and the English says "This campaign". Its zh-CN subject moves from 该营销活动 to 这个营销活动, the form the hook's sibling rows use for "this lead / this contact" (这个线索, 这个联系人). Everything after the subject is the hook's row.
  • Docs. src/marketing/docs/crm_marketing_automation.zh.md described Enroll Members refusing with the old phrase (活动已不在可加入成员的状态时); it now says 活动已不再开放报名时, which is also closer to its English twin ("If the campaign is no longer open"). The docs site (content/docs/**, zh-Hans and zh-Hant) states the rule in its own words and does not quote the refusal, so it needs no change; the What's New pages are historical and left alone. There are no Japanese docs.

Testing

  • test/campaign-member-direct-create-gates.test.ts gains a block that reads each shipped pack (zh-CN, ja-JP, es-ES) and asks, per locale: each Add to Campaign row, with {{ campaignRecord.name | default: "…" }} put as {{campaign}}, is the hook's named row; the same row with the filter's default substituted is the hook's bare message; and the Enroll Members row ends with everything the hook says after the name, with a worded subject and no interpolation.
  • Ablation: with the two packs put back to main's strings the block fails 4 tests (zh-CN and ja-JP, both assertions) and es-ES stays green; with this change all 25 tests in the file pass.
  • pnpm verify is green locally (332 test files, 6395 tests). Two of the review's nits were applied after that run (a comment, a function replacer in the test, one sentence of the changeset); pnpm typecheck, pnpm hygiene and the test file were run again after them and pass.
  • Merged with fix(marketing): one wording for Email Opt Out and its enrollment refusal at both doors (#2774) #2777: the files that PR changes under src/ and test/ were merged three-way into this tree (git merge-file, no conflicts in any of the eight), and test/campaign-member-direct-create-gates.test.ts plus test/campaign-enrollment-gates.test.ts pass on the result (52 tests), with tsc --noEmit clean.
  • Not verified in a browser: the change is to strings a refusal toast shows, and the pack rows are what the test reads.

Relation to #2777

#2777 (opt-out refusal, #2774) is open and touches the same three packs, the same manual page and the same test file. This PR is based on main and written to merge with it either way round (tried, see Testing): the pack and manual edits are on different lines, the test file's import line is changed to the same text #2777 changes it to, and the new block sits at the end of the file with its own constants inside its describe.

Review record

Independent read-only review by a fresh agent that had not read the author's conclusion (it was given the issue and the working-tree diff, and told to judge the Metadata-impact class itself).

Verdict: no must-fix and no should-fix findings. Metadata-impact: reviewer is correct: the diff is translations, one manual line, a test and a changeset; no hook, flow, object, permission, sharing rule, seed or validation is touched, and no governed path.

Reviewer's conclusion (the issue author's name is left out here):

  • 改了什么: zh-CN、ja-JP 两个语言包里「营销活动未开放报名」的三条流程拒绝语改成与钩子同一句话(只留主语不同),同步改了中文手册一行,新增一组按语言校验的测试和一份 changeset;英文、es-ES 及钩子、流程行为均未动。
  • 为什么改、谁提的: issue 营销:「营销活动未开放加入」的拒绝句在 zh-CN、ja-JP 里随入口不同而不同(钩子一句,流程另一句) #2778(p3)指出同一拒绝在「新建 / 导入 / API」「加入营销活动」「批量加入成员」三个入口的中、日文措辞不一致。
  • 最坏情况及能否撤回: 最坏只是中、日文用户看到的措辞不够自然(如日文 追加 与界面 登録 并存、活动名与中文之间不再有空格);不涉及数据和权限,回退这一个提交即可完全撤回。
  • 评审没有验证的内容: 未运行 pnpm verify 或 vitest,只在内存中对语言包源文本模拟了新断言;未在浏览器中看实际渲染;未与 fix(marketing): one wording for Email Opt Out and its enrollment refusal at both doors (#2774) #2777 实际合并,只按 hunk 行号推断无冲突;日文未经母语者审读;未核对中文文档的术语守卫测试是否接受新的一行。

Of what the review did not verify, the author's runs cover three (see Testing): pnpm verify and vitest, the actual merge with #2777, and the docs guards, which are part of pnpm verify. Still open: no browser check, and the Japanese has not been read by a native speaker.

Nits and what was done with them

  1. Manual line: 不再开放报名 brings 报名 into a page that otherwise says 加入; 不再开放 would mirror the English. Kept: it is the word the refusal itself now uses at every door, which is what the line describes.
  2. ja-JP Enroll Members now says 追加 in the refusal while the same flow's screens say 登録. Kept: the issue asks for the hook's sentence, and the pack already mixed the two (the flow's end_refused row uses both).
  3. zh-CN subject 该营销活动 → 这个营销活动 while another row in the pack still says 该. Kept: predates this change, and fix(marketing): one wording for Email Opt Out and its enrollment refusal at both doors (#2774) #2777 moves the same way.
  4. The test comment and the changeset said ja-JP differed in its quotes too; it differed in its verb and opening clause only. Fixed in both.
  5. row.replace(NAME, fallback!) would expand a $& in a default name. Fixed: the replacement is now a function.
  6. The Enroll Members assertion pins everything after the subject but not the subject itself, and English is not in the block's locales. Kept: the subject legitimately differs per locale and the file's first block already compares the two doors in English.

…r locale at every door (#2778)

In zh-CN and ja-JP the enrollment gate hook (New on a campaign's member
list, import, REST) and the Add to Campaign / Enroll Members flows each
translated the "not open for enrollment" refusal in their own words, so a
user read two different sentences for one rule. The flow rows now carry the
hook row's sentence; Enroll Members keeps its own subject ("this campaign").
English and es-ES already matched and are unchanged, as is every flow, hook
and object.

The Chinese marketing manual's line about Enroll Members uses the same word,
and the direct-create gates test now reads each shipped pack and asks every
flow row to be the hook's row.
@vercel

vercel Bot commented Nov 24, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Nov 24, 2026 12:42pm UTC

Request Review

@github-actions github-actions Bot added ci/cd CI plumbing and the verification pipeline metadata Declarative metadata — schema, security posture, UI surfaces labels Nov 24, 2026
@sunhaolin

Copy link
Copy Markdown
Collaborator Author

Seat record · 独立评审 · head 2734dcc9 · 2026-11-25

独立评审(只读子代理,未参与改动)结论:通过(有 nit)。Metadata-impact 同意 reviewer:拒绝条件不变,只改译文。

Findings

  1. src/marketing/translations/ja-JP.ts:188(nit,早于本 PR):拒绝句用「追加」,同一流程界面(:179–204)用「登録」;按 issue 要求所致,end_refused 那行本就混用。
  2. test/campaign-member-direct-create-gates.test.ts:200-254(nit,本 PR):只在语言包层比对,没有一条走 HTTP 入口固定 zh-CN 整句;fix(marketing): one wording for Email Opt Out and its enrollment refusal at both doors (#2774) #2777 在 campaign-enrollment-gates.test.ts 里有这样一条。

其他:issue 点名的三个入口(新建/导入/REST、加入营销活动、批量加入成员)均覆盖,四语每入口一整句;站点文档不引用这句,无需改;crm_marketing_automation.zh.md:16 已对上英文手册。

与 #2777:三方合并无冲突,措辞一致;建议 #2777 先合,本 PR 随后。

@sunhaolin
sunhaolin marked this pull request as ready for review November 25, 2026 01:33
@sunhaolin
sunhaolin added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 8b82a76 Nov 25, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI plumbing and the verification pipeline metadata Declarative metadata — schema, security posture, UI surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

营销:「营销活动未开放加入」的拒绝句在 zh-CN、ja-JP 里随入口不同而不同(钩子一句,流程另一句)

1 participant