Skip to content

refactor(website): normalize keys for nested translation catalogs - #18012

Closed
benceruleanlu wants to merge 4 commits into
bl/pr17244-02-locale-policyfrom
bl/pr17244-review-03-keys
Closed

benceruleanlu wants to merge 4 commits into
bl/pr17244-02-locale-policyfrom
bl/pr17244-review-03-keys

Conversation

@benceruleanlu

Copy link
Copy Markdown
Member

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.

benceruleanlu and others added 4 commits September 17, 2026 23:05
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.
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 77cf8970-ea13-43dd-8229-52c561ab5391

📥 Commits

Reviewing files that changed from the base of the PR and between e355db6 and 95a6df3.

📒 Files selected for processing (7)
  • apps/website/e2e/learning.spec.ts
  • apps/website/src/components/demos/ArcadeEmbed.vue
  • apps/website/src/components/learning/LearningCategoryNav.vue
  • apps/website/src/components/workshop/WorkshopCatalog.vue
  • apps/website/src/data/learningTutorials.ts
  • apps/website/src/i18n/translations.test.ts
  • apps/website/src/i18n/translations.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The change renames translation keys with explicit suffixes, updates their consumers, and adds a test that detects translation-key prefix collisions.

Changes

Translation key consistency

Layer / File(s) Summary
Translation key contract and validation
apps/website/src/i18n/translations.ts, apps/website/src/i18n/translations.test.ts
Renamed workshop, demo, and learning translation keys with .label, .message, or .text suffixes. Added validation for prefix collisions.
Learning category key consumers
apps/website/src/data/learningTutorials.ts, apps/website/src/components/learning/LearningCategoryNav.vue, apps/website/e2e/learning.spec.ts
Updated learning category label mappings, navigation labels, and breadcrumb assertions to use the suffixed keys.
Demo and workshop key consumers
apps/website/src/components/demos/ArcadeEmbed.vue, apps/website/src/components/workshop/WorkshopCatalog.vue
Updated the noscript fallback and workshop empty-state message to use the renamed keys.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested reviewers: christian-byrne, imick-io

Merge Risk: ⚪ Minimal · up to 95a6d

The renamed translations and updated visible consumers are consistent, with no identified merge-blocking behavior change.

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: normalizing website translation keys for nested catalogs.
Description check ✅ Passed The description includes a summary, change details, review focus, validation information, and related issue context. It is sufficiently complete for this change; omitted breaking-change, dependency, a…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
End-To-End Regression Coverage For Fixes ✅ Passed The PR title and commit subject use "refactor" language, not bug-fix language. The changed files are exclusively under apps/website, which the check explicitly excludes. The failure conditions are t…
Website End-To-End Regression Coverage ✅ Passed The PR changes website runtime files, so the check applies. However, the diff only normalizes translation keys and updates their consumers while preserving the message text and behavior. The custom ch…
Adr Compliance For Entity/Litegraph Changes ✅ Passed The changed-file list contains only apps/website/... translation, component, data, and test files. No changed file is under src/lib/litegraph/, src/ecs/, or a graph-entity-related path. The ADR …
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
billing-web Ignored Ignored Sep 18, 2026 6:45am UTC

Request Review

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

🔗 Website Preview

Website 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 95a6df3

@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

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           
Flag Coverage Δ
website-unit 74.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
apps/website/src/components/demos/ArcadeEmbed.vue 0.00% <ø> (ø)
...te/src/components/learning/LearningCategoryNav.vue 0.00% <ø> (ø)
...ebsite/src/components/workshop/WorkshopCatalog.vue 100.00% <ø> (ø)
apps/website/src/data/learningTutorials.ts 87.05% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 18, 2026
@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Sep 18, 2026
dante01yoon
dante01yoon previously approved these changes Sep 20, 2026

@dante01yoon dante01yoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts on 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-CN value on the 11 renamed entries is byte-identical to its old value — this is a pure key rename.
  • Consumers: grepped apps/website/src and apps/website/e2e for all 11 old keys. The five updated files cover every live consumer. workshop.proto.version, workshop.proto.session, workshop.proto.outcome and workshop.proto.gate have no consumers at all outside translations.ts, so renaming them is inert.
  • No dynamic key construction (t(\...`)/hasKey(`...`)) targets any of the renamed prefixes, so the TranslationKey` 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([])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@benceruleanlu
benceruleanlu dismissed stale reviews from dante01yoon and coderabbitai[bot] September 22, 2026 08:55

The merge-base changed after approval.

@benceruleanlu
benceruleanlu force-pushed the bl/pr17244-02-locale-policy branch from e355db6 to 9af84fa Compare September 22, 2026 08:55
@benceruleanlu
benceruleanlu requested review from a team September 22, 2026 08:55
@benceruleanlu
benceruleanlu force-pushed the bl/pr17244-02-locale-policy branch from f2b2137 to 6954f9a Compare September 22, 2026 21:44
@benceruleanlu

Copy link
Copy Markdown
Member Author

Closing: this PR only carried #17992, which has since merged to main and is already included in #17902's branch. Replaying its commit onto bl/pr17244-02-locale-policy produces an empty change. #18013 is now rebased directly onto #17902.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants