Repository navigation
refactor(website): stop using i18n keys as prefixes of other keys - #17992
Conversation
|
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-17992.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. This commit: https://website-frontend-j88ymckep-comfyui.vercel.app Last updated: 2026-09-18T04:18:15Z for |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe website now uses more specific translation keys for labels, text, and messages. Learning, demo, workshop, and breadcrumb references were updated. A test detects translation key prefix collisions. ChangesTranslation key updates
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to The translation-key refactor is mergeable with no identified impact on website behavior. 🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #17992 +/- ##
==========================================
+ Coverage 82.71% 82.72% +0.01%
==========================================
Files 2922 2896 -26
Lines 144012 143565 -447
Branches 37057 36952 -105
==========================================
- Hits 119115 118769 -346
+ Misses 23656 23575 -81
+ Partials 1241 1221 -20
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 26 files with indirect coverage changes 🚀 New features to boost your workflow:
|
1ee2d1f to
1cfb2d0
Compare
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.
1cfb2d0 to
b118343
Compare
dante01yoon
left a comment
There was a problem hiding this comment.
Verified the rename is complete and copy-preserving.
- All eleven keys are accounted for: the five
learning.categories.*leaves,demos.noscript,workshop.empty, and the fourworkshop.proto.*leaves. Each keeps its exact English and Chinese strings; only the key moves. - No stale references remain. Grepping the branch for the old spellings across
.ts/.vue/.astroreturns nothing outsidetranslations.ts, and every survivinglearning.categories.*usage inlearningTutorials.ts,LearningCategoryNav.vueande2e/learning.spec.tsnow resolves to.labelor one of the untouched.blurb/.heading/.description/.metaTitle/.metaDescriptionchildren. The dynamic key inlearning.spec.ts:320was the one thatTranslationKeycould not have caught statically, and it is updated. The fourworkshop.proto.*leaves have no consumers at all, so nothing there could break. - The new invariant test is correct: for
a.b.cit checksaanda.bagainst the key set and deliberately skips the full key, so it flags real prefix collisions without self-matching. It passes locally along with the rest oftranslations.test.ts(4 tests).
No findings. This is a clean prerequisite for the nested catalogs in #17991.
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: ready to approve — author-side follow-up assessment, not an independent approval. The current head already has an independent approval.
No actionable findings.
Checked and cleared
- The four unused
workshop.proto.*.labelentries were considered for deletion. Rejected as not introduced: the same unused entries exist on the base; this rename only makes the established catalog prefix-free. - The learning E2E assertion reconstructs its category translation key rather than reading
categoryLabelKeys. Rejected as not introduced: the base test uses the same construction; this change only follows the renamed leaf segment.
Coverage
Standard-depth correctness, maintainability, idiomaticity, tests, and documentation lanes reviewed all seven changed files and the PR claims. Prior findings: none; remaining findings: none.
Checks passed: pnpm typecheck; changed-file ESLint; pnpm oxlint:main (five unrelated baseline warnings); pnpm format:check; translation unit test (4/4); Playwright list for learning.spec.ts (27 tests discovered). Exact-head CI is green or skipped with no failures or pending checks.
Posted inline findings: 0; ledger candidates: 2 rejected as not introduced.
## Summary Add a manual `i18n: Update Website` workflow that runs the website translation target and commits the regenerated catalogs back to the dispatched branch, split out of Comfy-Org#17991 so it lands on `main` first: GitHub only registers dispatchable workflows from the default branch, so this is what makes the first Japanese run possible on the branch that introduces the catalogs. ## Changes - **What**: `.github/workflows/i18n-update-website.yaml`, `workflow_dispatch` only, branch refs only, `permissions: contents: read`. It checks out the dispatched ref with a blobless full history (the pipeline reads recorded English sources with `git cat-file`) without persisting credentials, runs `pnpm locale:website` with `OPENAI_API_KEY`, validates JSON, and pushes `apps/website/src/locales/` back with `PR_GH_TOKEN` scoped to that final push, mirroring `i18n-update-core.yaml` otherwise. ## Review Focus - `pnpm locale:website` and the catalogs it translates arrive with Comfy-Org#17991 (stacked on Comfy-Org#17992). Dispatching this workflow on `main` before that merges fails at the translate step with an unknown script; dispatching it on the Comfy-Org#17991 branch works, which is the intended first use. - No Playwright or ComfyUI server setup: unlike the core workflow, the website has no string collection step, so only the frontend setup runs. - The core workflow still persists `PR_GH_TOKEN` through checkout; applying the same scoping there is a separate change. Part of FE-2045. --------- Co-authored-by: Claude <noreply@anthropic.com>
Summary
Eleven website translation keys are both a message and the parent of other messages (
learning.categories.allnext tolearning.categories.all.blurb), which a nested vue-i18n catalog cannot express; give each such leaf its own segment so the catalogs can take the same nested shape as the app's.Changes
learning.categories.{all,basics,vfx,animations,ads}become….label,demos.noscriptbecomesdemos.noscript.text,workshop.emptybecomesworkshop.empty.message, andworkshop.proto.{version,outcome,gate,session}become….label, with their five consumers updated. A unit test now fails if any key is the prefix of another, so the invariant holds as copy is added.Review Focus
.blurb,.heading,.metaTitle, …) are untouched.Part of FE-2045.