mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add i18n support to tours
This commit is contained in:
@@ -164,6 +164,15 @@ RED.tourGuide = (function() {
|
||||
}
|
||||
finish();
|
||||
|
||||
}
|
||||
function getLocaleText(property) {
|
||||
if (typeof property === 'string') {
|
||||
return property;
|
||||
}
|
||||
var currentLang = RED.i18n.lang() || 'en-US';
|
||||
var availableLangs = Object.keys(property);
|
||||
return property[currentLang]||property['en-US']||property[availableLangs[0]]
|
||||
|
||||
}
|
||||
function runTourStep(step, state, done) {
|
||||
shade.fadeIn();
|
||||
@@ -214,9 +223,9 @@ RED.tourGuide = (function() {
|
||||
$('<h2><i class="'+step.titleIcon+'"></i></h2>').appendTo(stepDescription);
|
||||
}
|
||||
if (step.title) {
|
||||
$('<h2>').text(step.title).appendTo(stepDescription);
|
||||
$('<h2>').text(getLocaleText(step.title)).appendTo(stepDescription);
|
||||
}
|
||||
$('<div>').css("text-align","left").html(step.description).appendTo(stepDescription);
|
||||
$('<div>').css("text-align","left").html(getLocaleText(step.description)).appendTo(stepDescription);
|
||||
|
||||
var stepToolbar = $('<div>',{class:"red-ui-tourGuide-toolbar"}).appendTo(stepContent);
|
||||
|
||||
|
Reference in New Issue
Block a user