Fix output label on untranslated output names (#1866)

* Fix output label on untranslated output names

* nit

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-12-11 08:09:37 -08:00
committed by GitHub
parent d2bbf41fb5
commit 20a3a95df2
3 changed files with 4 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ import { type IBaseWidget } from '@comfyorg/litegraph/dist/types/widgets'
import { workflowService } from '@/services/workflowService'
import { useWidgetStore } from '@/stores/widgetStore'
import { deserialiseAndCreate } from '@/extensions/core/vintageClipboard'
import { st, t, te } from '@/i18n'
import { st } from '@/i18n'
import { normalizeI18nKey } from '@/utils/formatUtil'
export const ANIM_PREVIEW_WIDGET = '$$comfy_animation_preview'
@@ -1979,7 +1979,9 @@ export class ComfyApp {
const typeKey = `dataTypes.${normalizeI18nKey(output)}`
const outputOptions = {
...shapeOptions,
label: te(nameKey) ? t(nameKey) : st(typeKey, outputName)
label: nodeData['output_name'][o]
? st(nameKey, outputName)
: st(typeKey, outputName)
}
this.addOutput(outputName, output, outputOptions)
}