Use the action label if provided

This commit is contained in:
GogoVega
2025-10-10 13:38:03 +02:00
parent 6914814d85
commit 7c1505eeaf

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) {