mirror of
https://github.com/node-red/node-red.git
synced 2025-12-27 07:31:07 +01:00
Merge pull request #5302 from GogoVega/5157-action-label
Use the action label if provided
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user