Repository navigation
test(i18n): case and deal milestone rows read in the organization's language (#2817) - #2891
Merged
objectstack-fleet[bot] merged 2 commits intoDec 1, 2026
Conversation
…anguage The five activity-milestone timeline rows (case escalated, resolved, closed; deal won, lost) are translated in the zh-CN, ja-JP and es-ES packs under objects.OBJECT._milestones.FIELD.VALUE.summary since the move to ObjectStack 19 (#2820), and the platform composes the row at read time in the reader's language (objectstack#37524). Nothing pinned it. This suite boots the app twice, sets the organization's Localization language through the Settings route (the reader's language falls back to en-US, not to the app's i18n.defaultLocale), drives each transition as a person, and reads the timeline as that person: zh-CN reads the pack template with its token filled, en reads the authored sentence. Claude-Session: https://claude.ai/code/session_017xRBcUpajguxop2zMyDN9K
…estone-summaries-locale
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Author
|
repo:hotcrm@sunhaolin · sunhaolin · session_017xRBcUpajguxop2zMyDN9K 席位核对 · L1 ACCEPT · head
|
This was referenced Dec 1, 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.
Part of #2817
Clause-②: no
Metadata-protocol: none
Metadata-impact: reviewer — no metadata under src/ changes; one new test and one empty-frontmatter changeset
维护者速读
What changes
The milestone half of #2817 turned out to be delivered already. #2820 (c6e64ee, the move to ObjectStack 19) added
objects.OBJECT._milestones.FIELD.VALUE.summaryto the zh-CN, ja-JP and es-ES packs for all five rows: case escalated, resolved and closed, and deal won and lost. The platform slot from objectstack#37524 (PR objectstack-ai/objectstack#37582) ships in the19.0.0-next.3pin. Nothing pinned it, so this PR adds one suite:test/org-locale-milestone-timeline.test.tsboots the shipped app twice, once per organization language (zh-CN, en). Each boot sets the organization's Localization language throughPUT /api/settings/localization, the route the Setup page writes. It drives the five transitions as real people (a service agent on a case, a sales rep on two deals) and readssys_activityas that person. A zh-CN organization reads the zh-CN pack template with its{subject}/{name}token filled. An en organization reads the authored sentence. Each expected value comes from the object'sactivityMilestonesand the pack, not from hard-coded literals..changeset/2817-milestone-timeline-locale.mdis an empty-frontmatter changeset, because nothing ships to users.No file under
src/changes, includingcase.object.tsandopportunity.object.ts, so this PR cannot conflict with #2870's opportunity edit.The Log a Call / Log a Meeting summary half of #2817 is carried by #2582 (
src/sales/actions/activity-actions.ts) and is not touched here. Whichever of the two lands last closes the card.Read first (by risk):
test/org-locale-milestone-timeline.test.ts: thebeforeAllsettings write and thecontextForlocale assertion. The suite depends on these: the reader's language comes from the organization setting, not from the app default (see Acceptance notes).test/org-locale-milestone-timeline.test.ts:milestoneRows, which drops thecreatedrow and sorts by timestamp.Two-minute check:
pnpm exec vitest run test/org-locale-milestone-timeline.test.ts. Expect 6 passed: three per organization (the case escalated, resolved and closed; the deal won; the deal lost).Tests
ebc018a.enas the zh-CN organization's Localization language and dropped the locale assertion, which would otherwise trip first. The zh-CN half went red, 3 failed / 3 passed, receivingCase escalated — Line down 1where工单已升级 — Line down 1was expected, andDeal won — Milestone Deal 2where赢单 — Milestone Deal 2was expected. After restoring, the file was byte-identical (compared against the kept copy).Local readings
pnpm exec vitest run --maxWorkers=2 test/org-locale-milestone-timeline.test.tsonebc018a:Test Files 1 passed (1),Tests 6 passed (6),VERDICT command-exit 0.pnpm exec tsc --noEmitonebc018a: exit 0, noerror TS.--listFileson25976c5lists the new test, so typecheck covers it.pnpm hygiene: exit 0,source hygiene clean.19.0.0-next.3. A zh-CN organization member read工单已升级 / 工单已解决 / 工单已关闭 — SUBJECTand赢单 / 丢单 — NAME, and an en organization member read the authored sentences. In both organizations the stored row read as the system is the authored English sentence.Acceptance notes
19.0.0-next.3it no longer holds, because feat!: move to ObjectStack 19.0.0-next.2 and protocol 19 #2820 already translated them. What this PR adds is the pin.en-US, and anAccept-Languageheader overrides it per request. The app'si18n.defaultLocaleis not consulted. A boot declaringdefaultLocale: 'zh-CN'with no Localization setting gave a member context localeen-US, and the member readCase escalated — …. Stored text written throughctx.text(zh-CN org: automatic case escalation writes English reasons ("Auto-escalated: critical priority", "... SLA due date breached") #2494, zh-CN org: tasks created automatically carry English subjects ("Activate new customer for opportunity …", 5 hooks and flows) #2522) falls back to the app default instead, so the two can disagree in an organization whose admin never set the Localization language. The platform documents thectx.textfallback only, and I found no declared contract for the reader fallback, so I filed nothing. carrier: none.sys_activity.summarystays the authored English sentence by platform design (objectstack#37582). Only person reads are composed in the reader's language.Accept-Languagefrom its UI language.Verification
pnpm verifychain (validate, typecheck, lint, hygiene, build, test). Locally I ran the new suite, typecheck and hygiene.validate,lintandbuildread onlysrc/and config, which this diff does not touch.🤖 Generated with Claude Code
https://claude.ai/code/session_017xRBcUpajguxop2zMyDN9K