1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #3157 from node-red/relabel-file-nodes

Add paletteLabel to file nodes to make read/write more obvious
This commit is contained in:
Nick O'Leary 2021-10-04 10:56:01 +01:00 committed by GitHub
commit 126df969b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -210,9 +210,10 @@
if (this.overwriteFile === "delete") { if (this.overwriteFile === "delete") {
return this.name||this._("file.label.deletelabel",{file:this.filename}); return this.name||this._("file.label.deletelabel",{file:this.filename});
} else { } else {
return this.name||this.filename||this._("file.label.filelabel"); return this.name||this.filename||this._("file.label.write");
} }
}, },
paletteLabel: RED._("node-red:file.label.write"),
labelStyle: function() { labelStyle: function() {
return this.name?"node_label_italic":""; return this.name?"node_label_italic":"";
}, },
@ -290,8 +291,9 @@
}, },
icon: "file-in.svg", icon: "file-in.svg",
label: function() { label: function() {
return this.name||this.filename||this._("file.label.filelabel"); return this.name||this.filename||this._("file.label.read");
}, },
paletteLabel: RED._("node-red:file.label.read"),
labelStyle: function() { labelStyle: function() {
return this.name?"node_label_italic":""; return this.name?"node_label_italic":"";
}, },

View File

@ -863,6 +863,8 @@
}, },
"file": { "file": {
"label": { "label": {
"write": "write file",
"read": "read file",
"filename": "Filename", "filename": "Filename",
"action": "Action", "action": "Action",
"addnewline": "Add newline (\\n) to each payload?", "addnewline": "Add newline (\\n) to each payload?",
@ -870,7 +872,6 @@
"outputas": "Output", "outputas": "Output",
"breakchunks": "Break into chunks", "breakchunks": "Break into chunks",
"breaklines": "Break into lines", "breaklines": "Break into lines",
"filelabel": "file",
"sendError": "Send message on error (legacy mode)", "sendError": "Send message on error (legacy mode)",
"encoding": "Encoding", "encoding": "Encoding",
"deletelabel": "delete __file__", "deletelabel": "delete __file__",