From 75c98d00fcde6152c16e1127e988689b2a1181e3 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Wed, 11 Dec 2024 09:36:44 -0800 Subject: [PATCH] [i18n] Fix node output label translation (#1871) --- src/scripts/app.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 626cecaf8..076582b32 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -1979,9 +1979,14 @@ export class ComfyApp { const typeKey = `dataTypes.${normalizeI18nKey(output)}` const outputOptions = { ...shapeOptions, - label: nodeData['output_name'][o] - ? st(nameKey, outputName) - : st(typeKey, outputName) + // If the output name is different from the output type, use the output name. + // e.g. + // - type ("INT"); name ("Positive") => translate name + // - type ("FLOAT"); name ("FLOAT") => translate type + label: + output !== outputName + ? st(nameKey, outputName) + : st(typeKey, outputName) } this.addOutput(outputName, output, outputOptions) }