Merge pull request #5302 from GogoVega/5157-action-label

Use the action label if provided
This commit is contained in:
Nick O'Leary
2025-10-10 15:05:34 +01:00
committed by GitHub

View File

@@ -27,13 +27,10 @@ RED.actions = (function() {
return ''
}
if (!def.label) {
var options = def.options;
var key = options ? options.label : undefined;
if (!key) {
key = "action-list." +name.replace(/^.*:/,"");
}
var label = RED._(key);
if (label === key) {
const options = def.options;
const key = options?.label || "action-list." + name.replace(/^.*:/, "");
let label = RED._(key, { defaultValue: options?.label || "" });
if (!label) {
// no translation. convert `name` to description
label = name.replace(/(^.+:([a-z]))|(-([a-z]))/g, function() {
if (arguments[5] === 0) {