Comfy-Org / Comfy-Org/ComfyUI_frontend
refactor(litegraph): localize hardcoded 'Value' prompt titles in NumberWidget.ts via vue-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
Assessment
This issue has not been assessed yet.