Comfy-Org / Comfy-Org/Comfy-Desktop
Localize snapshot import/export validation errors
- Dominant language
- TypeScript
- Stars
- 458
- Forks
- 59
- Avg merge
- 22h 18m
- Merged PRs (30d)
- 45
Description
The snapshot envelope validation errors in `src/main/lib/snapshots/exportImport.ts` (`validateExportEnvelope()`) are hardcoded English strings that surface directly in the import UI:
- `Invalid file: not a JSON object`
- `Invalid file: not a Comfy Desktop snapshot export`
- `Unsupported snapshot version: N` (and the newer-file variant added in faf30f39: `This file was created by a newer version of Comfy Desktop; updating the app will likely allow importing it.`)
- `File contains no snapshots`
- `Invalid snapshot at index N` (and the `snapshot version exceeds envelope version` variant)
Other user-facing snapshot strings go through `i18n.t()` with keys in `locales/en.json` / `locales/zh.json`, so non-English users currently get untranslated errors on a failed import.
Follow-up from #1248: move these messages to i18n keys. Note that `validateExportEnvelope()` is also called from contexts where the message is logged rather than shown, so either translate at the throw site (consistent with `snapshotRestoreAfterInstallFailed` usage) or attach a key/params and translate at the UI boundary.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/main/lib/snapshots/exportImport.ts at validateExportEnvelope() and inspect its callers, especially the import UI and logging contexts. Review the existing snapshot translation keys and snapshotRestoreAfterInstallFailed usage in locales/en.json and locales/zh.json. Done means every listed validation error has i18n coverage with its parameters preserved, while logged errors remain appropriate in non-UI contexts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- localization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100