Comfy-Org / Comfy-Org/ComfyUI_frontend

i18n: node titles and the display-name index still snapshot the locale

Open
#14,777 1 comment 1 reaction 0 assignees View on GitHub
area:i18n
Dominant language
TypeScript
Stars
2k
Forks
704
Avg merge
1d 8h
Merged PRs (30d)
512

Description

Two remainders after #14775 (\`1def140b25\`), which made \`ComfyNodeDefImpl.display_name\`/\`description\` resolve at read time. Both were deliberately left out of that PR to keep its blast radius contained, and both are noted in its description.

## 1. \`node.title\` is baked at registration

\`src/services/litegraphService.ts\` sets \`node.title = nodeDef.display_name || nodeDef.name\` when a node type is registered (two sites: the subgraph path and \`registerNodeDef\`). That read goes through the new getter, so it is correct **at registration time** — but it is a one-shot copy onto the litegraph class.

Consequence: switching locale, or a backend rename picked up by \`Comfy.RefreshNodeDefinitions\`, updates the node library, search, and context menus, while nodes already on the canvas keep the title they were constructed with until reload.

Note the interaction with serialization: \`LGraphNode.serialize\` only writes \`title\` when \`this.title != this.constructor.title\`. Within a session both move together, so this does not dirty saved workflows today. A fix needs to keep that invariant.

## 2. \`nodeDefsByDisplayName\` snapshots its keys

\`src/stores/nodeDefStore.ts\` builds \`nodeDefsByDisplayName\` by reading \`nodeDef.display_name\` at write time, so the **keys** freeze even though the values now resolve live. After a locale switch the map is keyed on the previous locale's names.

Low urgency: it has exactly one consumer in \`src/\` (\`src/composables/useEssentialTileNodeDef.ts:19\`), and \`allNodeDefsByDisplayName\` is a computed that re-derives. Worth fixing when someone is next in that file rather than on its own.

Neither is a regression from #14775 — before it, everything was baked at fetch time, so both were strictly worse. These are the last two places the old model survives.

Related: #14541, #14629, #14747

Contributor guide

Open the contributing guide

Research direction

Start in src/services/litegraphService.ts at the subgraph and registerNodeDef registration sites, then inspect LGraphNode.serialize to preserve its title comparison invariant. Next read src/stores/nodeDefStore.ts and its sole consumer, src/composables/useEssentialTileNodeDef.ts:19. Done means existing canvas titles follow locale or refreshed definitions, and display-name lookup keys remain current without dirtying saved workflows.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, internationalization
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.