Uh oh!
There was an error while loading. Please reload this page.
feat(access): localize curated capability labels client-side (#2600 B5 follow-up) - #2657
Merged
Merged
Conversation
…5 follow-up) Follow-up to #2653 (which localized the picker's group headers). The capability chip *labels* (Manage Metadata, Studio Access, …) are served in English by the sys_capability registry. Framework registry localization turned out to require a new record-data i18n pattern (no existing convention), which is disproportionate for this — the curated platform capabilities are a FIXED, known set, so localize just those on the client: - CapabilityMultiSelectField resolves labels for the 7 curated platform caps via `capability.label.<name>` (dots → underscores); package-/admin-authored capabilities keep their registry-served label. - Added the keys to useFieldTranslation defaults + en/zh bundles (others fall back to en; nested under the existing top-level `capability` key so locale parity is unaffected). Also made the toggle-off test re-query the chip at click time: the label now resolves through i18n, so an async translation-settle can re-render the chips between findBy and click — asserting on a re-queried node avoids a detached-node race. Adds a curated-vs-registry label test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Uh oh!
There was an error while loading. Please reload this page.
8 tasks
This was referenced Aug 16, 2026
Merged
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 freeto 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.
What
Follow-up to #2653 (group headers). The capability chip labels (Manage Metadata, Studio Access, …) are served in English by the
sys_capabilityregistry, so they appeared in English even in a Chinese UI.Why not framework: I explored making the framework registry serve locale-aware labels, but it has no record-data i18n convention — the schema-translation bundles localize object/field schema only, and the labels are plain record data on the generic
/api/v1/dataendpoint. A backend fix would mean a new pattern (a read middleware + a translation store + a locale-source decision), disproportionate for the issue's lowest-priority item. The curated platform capabilities are a fixed, known set, so localizing them on the client is the proportionate fix.Change
CapabilityMultiSelectFieldresolves labels for the 7 curated platform caps viacapability.label.<name>(dots → underscores); package-/admin-authored capabilities keep their registry-served label.useFieldTranslationdefaults + en/zh bundles (nested under the existing top-levelcapabilitykey, so locale-parity is unaffected; other locales fall back to en).Test note
The toggle-off test now re-queries the chip at click time: the label resolves through i18n, so an async translation-settle can re-render the chips between
findByandfireEvent.click, detaching the awaited node (a re-queried node clicks fine — verified theonChangefires). Added a curated-vs-registry label test.Verify (live, Chinese UI)
Capability picker chips render localized: 管理元数据 / 管理平台设置 / 管理用户 / 访问 Setup / 访问 Studio / 管理组织用户 / 保存设置 — no raw keys, no flicker.
Tests
CapabilityMultiSelectField(10) + i18n locale-parity +useFieldTranslation— 107 tests green.🤖 Generated with Claude Code