Skip to content

refactor(website): stop using i18n keys as prefixes of other keys - #17992

Merged
benceruleanlu merged 1 commit into
mainfrom
drjkl/website-i18n-key-collisions
Sep 21, 2026
Merged

benceruleanlu merged 1 commit into
mainfrom
drjkl/website-i18n-key-collisions

Conversation

@DrJKL

@DrJKL DrJKL commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Eleven website translation keys are both a message and the parent of other messages (learning.categories.all next to learning.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

  • What: learning.categories.{all,basics,vfx,animations,ads} become ….label, demos.noscript becomes demos.noscript.text, workshop.empty becomes workshop.empty.message, and workshop.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

Part of FE-2045.

@DrJKL
DrJKL requested review from a team September 18, 2026 02:41
@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 2:41am 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-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 b118343

@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: Team

Run ID: a4f5516c-97b1-4306-8fda-58143062a19b

📥 Commits

Reviewing files that changed from the base of the PR and between e057d1c and 1ee2d1f.

📒 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 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The 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.

Changes

Translation key updates

Layer / File(s) Summary
Rename ambiguous translation keys
apps/website/src/i18n/translations.ts
Translation keys now use explicit .label, .text, and .message suffixes. Learning category blurbs remain unchanged.
Update translation references
apps/website/src/data/learningTutorials.ts, apps/website/src/components/learning/LearningCategoryNav.vue, apps/website/src/components/demos/ArcadeEmbed.vue, apps/website/src/components/workshop/WorkshopCatalog.vue, apps/website/e2e/learning.spec.ts
Website components, learning data, and the learning breadcrumb test now reference the renamed keys.
Detect translation key prefix collisions
apps/website/src/i18n/translations.test.ts
The test suite checks that no registered translation key is a dot-separated prefix of another key.

Priority: ⬇️ Low

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

Change: Refactor

Suggested reviewers: christian-byrne

Merge Risk: ⚪ Minimal · up to 1ee2d

The translation-key refactor is mergeable with no identified impact on website behavior.

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
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 title and commit subject use “refactor,” not bug-fix language. All listed changes are under apps/website, which the check explicitly excludes because that package has its own end-to-end coverage…
Website End-To-End Regression Coverage ✅ Passed The PR changes website runtime files, but the diff only renames translation keys and updates their consumers. The PR description states that English, Chinese, and Japanese text remain unchanged, and t…
Adr Compliance For Entity/Litegraph Changes ✅ Passed The changed-file list contains only website i18n, component, data, and test files. No changed file is under src/lib/litegraph/, src/ecs/, or a graph-entity-related path. The ADR compliance check i…
Description check ✅ Passed The description includes a clear summary, the main changes, review focus, compatibility details, and issue context. The required sections are sufficiently complete, and screenshots are not applicable …
Title check ✅ Passed The title clearly and concisely describes the main change: preventing i18n keys from being prefixes of other keys.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
📝 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.

@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Sep 18, 2026
@codecov

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

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     
Flag Coverage Δ
billing-web-unit ?
website-unit 74.73% <ø> (ø)

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% <ø> (ø)

... and 26 files with indirect coverage changes

🚀 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.

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.

@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.

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 four workshop.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/.astro returns nothing outside translations.ts, and every surviving learning.categories.* usage in learningTutorials.ts, LearningCategoryNav.vue and e2e/learning.spec.ts now resolves to .label or one of the untouched .blurb/.heading/.description/.metaTitle/.metaDescription children. The dynamic key in learning.spec.ts:320 was the one that TranslationKey could not have caught statically, and it is updated. The four workshop.proto.* leaves have no consumers at all, so nothing there could break.
  • The new invariant test is correct: for a.b.c it checks a and a.b against 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 of translations.test.ts (4 tests).

No findings. This is a clean prerequisite for the nested catalogs in #17991.

@benceruleanlu
benceruleanlu added this pull request to the merge queue Sep 21, 2026
Merged via the queue into main with commit 4916263 Sep 21, 2026
77 checks passed
@benceruleanlu
benceruleanlu deleted the drjkl/website-i18n-key-collisions branch September 21, 2026 18:34

@DrJKL DrJKL left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.*.label entries 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.

xmarre pushed a commit to xmarre/ComfyUI_frontend that referenced this pull request Sep 21, 2026
## 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>
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.

4 participants