fix(plugin-audit): localize activity summaries to the workspace locale (#3039)#3045
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 4 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
#3039) Activity writers hardcoded English verbs and the object API name (`Created person_qualification "OC-00001"`) regardless of the workspace localization.locale setting. writeAudit now: - resolves the ADR-0053 workspace locale per write via a lazy getLocale seam (resolveLocalizationContext), memoized per tenant/user scope with a 30s TTL so audit logging adds no settings query to the CRUD hot path - renders create/delete and the generic update fallback through new messages.activityCreated/Updated/Deleted i18n templates (en, zh-CN, ja-JP, es-ES shipped in the plugin bundle); keys are single-segment because both i18n implementations resolve dot-paths by walking nested objects - names the object by its localized label (objects.{name}.label), falling back to the authored def label, then the API name Both services resolve lazily through structural seams (AuditI18nSurface, mirroring MessagingEmitSurface); missing i18n/settings or bundle keys degrade to the previous English summaries.
This was referenced Jul 16, 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.
Closes #3039
Problem
installAuditWritershardcoded English verbs and the object API name into every activity summary —Created person_qualification "OC-00001"— regardless of the workspacelocalization.localesetting (ADR-0053). The summary is baked into thesys_activityrow at write time, so no UI-side fix is possible.Fix
writeAuditresolves the workspace default locale per write through a new lazygetLocaleseam (resolveLocalizationContext), memoized per tenant/user scope with a 30s TTL so audit logging adds no settings query to the CRUD hot path.messages.activityCreated/Updated/Deletedi18n templates; en / zh-CN / ja-JP / es-ES ship in the plugin bundle. zh-CN yields the issue's expected创建了 人员资质 "OC-00001".objects.{name}.label) → authored def label → API name.AuditI18nSurfaceseam (mirroringMessagingEmitSurface); missing i18n/settings services or bundle keys degrade to the previous English summaries, so existing deployments are unaffected.activityCreated) because both i18n implementations (memory fallback + FileI18nAdapter) resolve dot-paths by walking nested objects — a flat dotted record key would never resolve.Tests
pnpm --filter @objectstack/plugin-audit test— 38/38 (6 new: zh-CN create/delete/update summaries via the realcreateMemoryI18n+ shipped bundle, def-label fallback, no-i18n degradation, locale memoization). Build + DTS green. Patch changeset included.Related UI-side fix (list/detail relative-date humanize, #3040): objectstack-ai/objectui PR from branch
claude/framework-issues-3040-3039-b413f4.