Comfy-Org / Comfy-Org/ComfyUI_frontend

refactor(litegraph): localize hardcoded 'Value' prompt titles in NumberWidget.ts via vue-i18n

Open
#9,389 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
area:i18n
Dominant language
TypeScript
Stars
2k
Forks
704
Avg merge
1d 8h
Merged PRs (30d)
512

Description

## Follow-up: Localize hardcoded prompt titles in `NumberWidget.ts`

### Context
In PR #8985, the `NumberWidget.ts` file introduced two `canvas.prompt('Value', ...)` calls that use a hardcoded string title. The file already imports and uses `t()` from `'@/i18n'` (e.g., `t('widgets.editExpression')`), so these prompt titles should be routed through vue-i18n for consistency.

Flagged in review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/8985#discussion_r2876836663
Requested by: @christian-byrne

### Changes needed

1. Add a new translation key to `src/locales/en/main.json` under the `widgets` section:
```json
"valuePromptTitle": "Value"
```

2. In `src/lib/litegraph/src/widgets/NumberWidget.ts`, replace both hardcoded `'Value'` strings in the `canvas.prompt()` calls with `t('widgets.valuePromptTitle')`.

### Files to update
- `src/lib/litegraph/src/widgets/NumberWidget.ts`
- `src/locales/en/main.json`

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-9389-refactor-litegraph-localize-hardcoded-Value-prompt-titles-in-NumberWidget-ts-via-v-3196d73d365081d8831dcb553048edc9) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.