From f6b90c827106707337bbcbf87a012389a1cb4155 Mon Sep 17 00:00:00 2001 From: Kazuhito Yokoi Date: Tue, 29 Jun 2021 18:02:06 +0900 Subject: [PATCH] Fix output label in file-in node --- .../@node-red/nodes/core/storage/10-file.html | 13 +++++++++++-- .../@node-red/nodes/locales/en-US/messages.json | 2 ++ .../@node-red/nodes/locales/ja/messages.json | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/nodes/core/storage/10-file.html b/packages/node_modules/@node-red/nodes/core/storage/10-file.html index 4de59848e..3ba906fdf 100755 --- a/packages/node_modules/@node-red/nodes/core/storage/10-file.html +++ b/packages/node_modules/@node-red/nodes/core/storage/10-file.html @@ -276,8 +276,17 @@ inputs:1, outputs:1, outputLabels: function(i) { - var l = this._(((this.format === "utf8")||(this.format === "lines")) ? "file.label.utf8String" : "file.label.binaryBuffer"); - return ( l + (((this.format === "lines")||(this.format === "stream")) ? "s" : "") ); + var l; + if (this.format === "utf8") { + l = "file.label.utf8String"; + } else if (this.format === "lines") { + l = "file.label.utf8String_plural"; + } else if (this.format === "stream") { + l = "file.label.binaryBuffer_plural"; + } else { + l = "file.label.binaryBuffer"; + } + return this._(l); }, icon: "file-in.svg", label: function() { diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json index a990b3ba5..a9e50a77d 100755 --- a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json @@ -861,7 +861,9 @@ "encoding": "Encoding", "deletelabel": "delete __file__", "utf8String": "UTF8 string", + "utf8String_plural": "UTF8 strings", "binaryBuffer": "binary buffer", + "binaryBuffer_plural": "binary buffers", "allProps": "include all existing properties in each msg" }, "action": { diff --git a/packages/node_modules/@node-red/nodes/locales/ja/messages.json b/packages/node_modules/@node-red/nodes/locales/ja/messages.json index 6ac8dfe1b..fa1b843fc 100644 --- a/packages/node_modules/@node-red/nodes/locales/ja/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/ja/messages.json @@ -859,7 +859,9 @@ "encoding": "文字コード", "deletelabel": "delete __file__", "utf8String": "UTF8文字列", + "utf8String_plural": "UTF8文字列", "binaryBuffer": "バイナリバッファ", + "binaryBuffer_plural": "バイナリバッファ", "allProps": "各メッセージに既存の全プロパティを含める" }, "action": {