Repository navigation
refactor(website): normalize keys for nested translation catalogs - #18012
benceruleanlu wants to merge 4 commits into
Conversation
Eleven website translation keys were both a message and the parent of other messages (learning.categories.all next to learning.categories.all.blurb), which a nested catalog cannot express. Give each such leaf its own segment (label, text or message) and update the consumers, and add a test that keeps the key set prefix-free so the catalogs can take the same nested shape as the app's.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change renames translation keys with explicit suffixes, updates their consumers, and adds a test that detects translation-key prefix collisions. ChangesTranslation key consistency
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to The renamed translations and updated visible consumers are consistent, with no identified merge-blocking behavior change. 🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
🌐 Website E2ETip All tests passed.
🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-18012.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. This commit: https://website-frontend-7bgozjb1b-comfyui.vercel.app Last updated: 2026-09-18T06:46:57Z for |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## bl/pr17244-02-locale-policy #18012 +/- ##
============================================================
Coverage 82.74% 82.74%
============================================================
Files 2900 2900
Lines 143707 143707
Branches 36972 36972
============================================================
Hits 118909 118909
Misses 23577 23577
Partials 1221 1221
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
dante01yoon
left a comment
There was a problem hiding this comment.
Approving at 95a6df3d. I verified the rename is complete and lossless rather than taking the summary on trust.
What I checked
- Extracted all keys from
translations.tson both sides: 2887 before, 2887 after — no key added or dropped, and no duplicate keys. - Ran the new prefix-collision check against the base branch (
bl/pr17244-02-locale-policy): 44 colliding leaves, all rooted at exactly the 11 keys this PR renames. Against this head: 0 collisions. So the invariant the new test encodes genuinely holds now and genuinely did not before. - Every
en/zh-CNvalue on the 11 renamed entries is byte-identical to its old value — this is a pure key rename. - Consumers: grepped
apps/website/srcandapps/website/e2efor all 11 old keys. The five updated files cover every live consumer.workshop.proto.version,workshop.proto.session,workshop.proto.outcomeandworkshop.proto.gatehave no consumers at all outsidetranslations.ts, so renaming them is inert. - No dynamic key construction (
t(\...`)/hasKey(`...`)) targets any of the renamed prefixes, so theTranslationKey` type covers the whole blast radius.
One non-blocking nit inline.
| .slice(1) | ||
| .some((_, index) => keys.has(segments.slice(0, index + 1).join('.'))) | ||
| }) | ||
| expect(collisions).toEqual([]) |
There was a problem hiding this comment.
nit-pick (non-blocking): the collision is detected from the descendant side, so the failure message names the child rather than the key that actually has to be renamed.
On the base branch this same check reports 44 entries — learning.categories.all.blurb, learning.categories.basics.heading, workshop.proto.outcome.expired, and so on — when the fix is to rename the 11 parents (learning.categories.all, workshop.proto.outcome, ...). Whoever hits this next has to work backwards from a long list of children to a short list of offenders.
Collecting the offending prefix instead would point straight at the fix, e.g.:
const collisions = translationKeys.flatMap((key) => {
const segments = key.split('.')
return segments
.slice(1)
.map((_, index) => segments.slice(0, index + 1).join('.'))
.filter((prefix) => keys.has(prefix))
})
expect([...new Set(collisions)]).toEqual([])Purely a diagnostics improvement — the pass/fail behaviour is identical and correct as written.
The merge-base changed after approval.
e355db6 to
9af84fa
Compare
f2b2137 to
6954f9a
Compare
Summary
Normalize eleven website translation keys so messages can move into nested JSON catalogs.
Changes
Review Focus
Key prefixes must not be both a leaf and an object. Foundation 3/18, prerequisite for the catalog migration.
Validation: Independent context-free review verified all 2,887 messages and consumers at 95a6df3; no actionable findings.
Part of the #17244 localization stack and FE-2045 foundation convergence. Local peer review is not a GitHub approval.