mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Palette category label NLS for core nodes
This commit is contained in:
parent
24efdbe4da
commit
fe9dc6b272
@ -19,10 +19,10 @@ RED.palette = (function() {
|
|||||||
var exclusion = ['config','unknown','deprecated'];
|
var exclusion = ['config','unknown','deprecated'];
|
||||||
var core = ['subflows', 'input', 'output', 'function', 'social', 'storage', 'analysis', 'advanced'];
|
var core = ['subflows', 'input', 'output', 'function', 'social', 'storage', 'analysis', 'advanced'];
|
||||||
|
|
||||||
function createCategoryContainer(category){
|
function createCategoryContainer(category, label){
|
||||||
var escapedCategory = category.replace(" ","_");
|
label = label || category.replace("_", " ");
|
||||||
var catDiv = $("#palette-container").append('<div id="palette-container-'+category+'" class="palette-category hide">'+
|
var catDiv = $("#palette-container").append('<div id="palette-container-'+category+'" class="palette-category hide">'+
|
||||||
'<div id="palette-header-'+category+'" class="palette-header"><i class="expanded fa fa-caret-down"></i><span>'+category.replace("_"," ")+'</span></div>'+
|
'<div id="palette-header-'+category+'" class="palette-header"><i class="expanded fa fa-caret-down"></i><span>'+label+'</span></div>'+
|
||||||
'<div class="palette-content" id="palette-base-category-'+category+'">'+
|
'<div class="palette-content" id="palette-base-category-'+category+'">'+
|
||||||
'<div id="palette-'+category+'-input"></div>'+
|
'<div id="palette-'+category+'-input"></div>'+
|
||||||
'<div id="palette-'+category+'-output"></div>'+
|
'<div id="palette-'+category+'-output"></div>'+
|
||||||
@ -268,9 +268,13 @@ RED.palette = (function() {
|
|||||||
function init() {
|
function init() {
|
||||||
$(".palette-spinner").show();
|
$(".palette-spinner").show();
|
||||||
if (RED.settings.paletteCategories) {
|
if (RED.settings.paletteCategories) {
|
||||||
RED.settings.paletteCategories.forEach(createCategoryContainer);
|
RED.settings.paletteCategories.forEach(function(category){
|
||||||
|
createCategoryContainer(category, category); // TODO NLS enable categories from settings
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
core.forEach(createCategoryContainer);
|
core.forEach(function(category){
|
||||||
|
createCategoryContainer(category, RED._("palette.core."+category));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#palette-search-input").focus(function(e) {
|
$("#palette-search-input").focus(function(e) {
|
||||||
|
@ -126,7 +126,17 @@
|
|||||||
"palette": {
|
"palette": {
|
||||||
"noInfo": "no information available",
|
"noInfo": "no information available",
|
||||||
"popOverError": "Error generating pop-over label for '__type__'.",
|
"popOverError": "Error generating pop-over label for '__type__'.",
|
||||||
"filter": "filter"
|
"filter": "filter",
|
||||||
|
"core": {
|
||||||
|
"subflows": "subflows",
|
||||||
|
"input": "input",
|
||||||
|
"output": "output",
|
||||||
|
"function": "function",
|
||||||
|
"social": "social",
|
||||||
|
"storage": "storage",
|
||||||
|
"analysis": "analysis",
|
||||||
|
"advanced": "advanced"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"tabInfo": {
|
"tabInfo": {
|
||||||
"node": "Node",
|
"node": "Node",
|
||||||
|
Loading…
Reference in New Issue
Block a user