diff --git a/editor/js/text/format.js b/editor/js/text/format.js index 937bd6a43..ddb568b86 100644 --- a/editor/js/text/format.js +++ b/editor/js/text/format.js @@ -758,7 +758,7 @@ RED.text.format = (function() { { guiDir: isRtl ? "rtl" : "ltr", dir: "ltr", - points: "/\\:." + points: "/\\:.&<>" }; if (!parseOnly) { return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale); @@ -876,7 +876,7 @@ RED.text.format = (function() { { guiDir: isRtl ? "rtl" : "ltr", dir: "ltr", - points: ":?#/@.[]=" + points: ":?#/@.[]=&<>" }; if (!parseOnly) { return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale); @@ -1304,6 +1304,18 @@ RED.text.format = (function() { } return { + /** + * Returns the string representation of a given structured text + * @param text - the structured text + * @param type - could be one of filepath, url, email + * @param args - pass additional arguments to the handler. generally null. + * @param isRtl - indicates if the GUI is mirrored + * @param locale - the browser locale + */ + getString: function (text, type, args, isRtl, locale) { + return getHandler(type).format(text, args, isRtl, false, locale); + }, + /** * Returns the HTML representation of a given structured text * @param text - the structured text diff --git a/nodes/core/io/21-httpin.html b/nodes/core/io/21-httpin.html index 84b0f39cf..c2c93fdb6 100644 --- a/nodes/core/io/21-httpin.html +++ b/nodes/core/io/21-httpin.html @@ -137,7 +137,7 @@ msg.cookies = { } else { root += this.url; } - return "["+this.method+"] "+root; + return RED.text.format.getString("["+this.method+"] "+root, "url", {}, false, "en"); } else { return "http"; } diff --git a/nodes/core/io/22-websocket.html b/nodes/core/io/22-websocket.html index ca74898f7..d3bdc4cb4 100644 --- a/nodes/core/io/22-websocket.html +++ b/nodes/core/io/22-websocket.html @@ -160,7 +160,7 @@ } else { root += this.path; } - return root; + return RED.text.format.getString(root, "filepath", {}, false, "en"); }, oneditprepare: function() { var root = RED.settings.httpNodeRoot; @@ -185,7 +185,7 @@ inputs:0, outputs:0, label: function() { - return this.path; + return RED.text.format.getString(this.path, "filepath", {}, false, "en"); } }); diff --git a/nodes/core/io/23-watch.html b/nodes/core/io/23-watch.html index 90149fdfe..f0d983743 100644 --- a/nodes/core/io/23-watch.html +++ b/nodes/core/io/23-watch.html @@ -53,7 +53,7 @@ outputs:1, icon: "watch.png", label: function() { - return this.name||this.files; + return this.name||RED.text.format.getString(this.files, "filepath", {}, false, "en"); }, labelStyle: function() { return this.name?"node_label_italic":""; diff --git a/nodes/core/storage/28-tail.html b/nodes/core/storage/28-tail.html index f8aa1ee0d..4005c424d 100644 --- a/nodes/core/storage/28-tail.html +++ b/nodes/core/storage/28-tail.html @@ -57,7 +57,7 @@ outputs:1, icon: "file.png", label: function() { - return this.name||this.filename; + return this.name||RED.text.format.getString(this.filename, "filepath", {}, false, "en"); }, labelStyle: function() { return this.name?"node_label_italic":""; diff --git a/nodes/core/storage/50-file.html b/nodes/core/storage/50-file.html index 39cd822a8..f3a473bf0 100644 --- a/nodes/core/storage/50-file.html +++ b/nodes/core/storage/50-file.html @@ -95,9 +95,9 @@ align: "right", label: function() { if (this.overwriteFile === "delete") { - return this.name||this._("file.label.deletelabel",{file:this.filename}) + return this.name||this._("file.label.deletelabel",{file:RED.text.format.getString(this.filename, "filepath", {}, false, "en")}) } else { - return this.name||this.filename||this._("file.label.filelabel"); + return this.name||RED.text.format.getString(this.filename, "filepath", {}, false, "en")||this._("file.label.filelabel"); } }, labelStyle: function() { @@ -123,7 +123,7 @@ outputs:1, icon: "file.png", label: function() { - return this.name||this.filename||this._("file.label.filelabel"); + return this.name||RED.text.format.getString(this.filename, "filepath", {}, false, "en")||this._("file.label.filelabel"); }, labelStyle: function() { return this.name?"node_label_italic":"";