Palette category label NLS for core nodes

This commit is contained in:
Allen Boone 2015-06-10 16:39:39 -04:00 committed by Nick O'Leary
parent 24efdbe4da
commit fe9dc6b272
2 changed files with 20 additions and 6 deletions

View File

@ -19,10 +19,10 @@ RED.palette = (function() {
var exclusion = ['config','unknown','deprecated'];
var core = ['subflows', 'input', 'output', 'function', 'social', 'storage', 'analysis', 'advanced'];
function createCategoryContainer(category){
var escapedCategory = category.replace(" ","_");
function createCategoryContainer(category, label){
label = label || category.replace("_", " ");
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 id="palette-'+category+'-input"></div>'+
'<div id="palette-'+category+'-output"></div>'+
@ -268,9 +268,13 @@ RED.palette = (function() {
function init() {
$(".palette-spinner").show();
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 {
core.forEach(createCategoryContainer);
core.forEach(function(category){
createCategoryContainer(category, RED._("palette.core."+category));
});
}
$("#palette-search-input").focus(function(e) {

View File

@ -126,7 +126,17 @@
"palette": {
"noInfo": "no information available",
"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": {
"node": "Node",