diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tour/tourGuide.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tour/tourGuide.js index 019a14d4d..ddb89431e 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tour/tourGuide.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tour/tourGuide.js @@ -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() { $('

').appendTo(stepDescription); } if (step.title) { - $('

').text(step.title).appendTo(stepDescription); + $('

').text(getLocaleText(step.title)).appendTo(stepDescription); } - $('
').css("text-align","left").html(step.description).appendTo(stepDescription); + $('
').css("text-align","left").html(getLocaleText(step.description)).appendTo(stepDescription); var stepToolbar = $('
',{class:"red-ui-tourGuide-toolbar"}).appendTo(stepContent); diff --git a/packages/node_modules/@node-red/editor-client/src/tours/welcome.js b/packages/node_modules/@node-red/editor-client/src/tours/welcome.js index 1a4f59f9d..f425a3f1e 100644 --- a/packages/node_modules/@node-red/editor-client/src/tours/welcome.js +++ b/packages/node_modules/@node-red/editor-client/src/tours/welcome.js @@ -3,13 +3,13 @@ export default { steps: [ { titleIcon: "fa fa-map-o", - title: "Welcome to Node-RED 2.1!", - description: "Let's take a moment to discover the new features in this release." + title: { "en-US": "Welcome to Node-RED 2.1!" }, + description: { "en-US": "Let's take a moment to discover the new features in this release." } }, { - title: "A new Tour Guide", - description: "

First, as you've already found, we now have this tour of new features. We'll only show the tour the first time you open the editor for each new version of Node-RED.

"+ - "

You can choose not to see this tour in the future by disabling it under the View tab of User Settings.

", + title: { "en-US": "A new Tour Guide" }, + description: { "en-US": "

First, as you've already found, we now have this tour of new features. We'll only show the tour the first time you open the editor for each new version of Node-RED.

"+ + "

You can choose not to see this tour in the future by disabling it under the View tab of User Settings.

" } }, { prepare() { @@ -22,9 +22,9 @@ export default { element: "#menu-item-edit-menu-submenu", interactive: false, direction: "left", - title: "New Edit menu", - description: "

The main menu has been updated with a new 'Edit' section. This includes all of the familar options, like cut/paste and undo/redo.

"+ - "

The menu now displays keyboard shortcuts for the options.

" + title: { "en-US": "New Edit menu" }, + description: { "en-US": "

The main menu has been updated with a new 'Edit' section. This includes all of the familar options, like cut/paste and undo/redo.

"+ + "

The menu now displays keyboard shortcuts for the options.

" } }, { @@ -38,13 +38,13 @@ export default { element: "#menu-item-arrange-menu-submenu", interactive: false, direction: "left", - title: "Arranging nodes", - description: "

The new 'Arrange' section of the menu provides new options to help arrange your nodes. You can align them to a common edge, spread them out evenly or change their order.

", + title: { "en-US": "Arranging nodes" }, + description: { "en-US": "

The new 'Arrange' section of the menu provides new options to help arrange your nodes. You can align them to a common edge, spread them out evenly or change their order.

" }, }, { element: "#red-ui-workspace-tabs > li:first-child", - title: "Flow and Group level environment variables", - description: "

Flows and Groups can now have their own environment variables that can be referenced by nodes inside them.

", + title: { "en-US": "Flow and Group level environment variables" }, + description: { "en-US": "

Flows and Groups can now have their own environment variables that can be referenced by nodes inside them.

" }, }, { prepare(done) { @@ -52,19 +52,19 @@ export default { setTimeout(done,800); }, element: "#red-ui-tab-editor-tab-envProperties-link-button", - description: "

Flows and Groups now have an Environment Variables section in their edit dialog.

" + description: { "en-US": "

Flows and Groups now have an Environment Variables section in their edit dialog.

" }, }, { element: ".node-input-env-container-row .red-ui-editableList-addButton", direction: "top", - description: '

The environment variables are listed in this table and new ones can be added by clicking the button.

', + description: { "en-US": '

The environment variables are listed in this table and new ones can be added by clicking the button.

' }, complete() { $("#node-dialog-cancel").trigger("click"); } }, { - title: "And that's not all...", - description: "

There's more still to come before 2.1.0 is released. Watch this space!

" + title: { "en-US": "And that's not all..." }, + description: { "en-US": "

There's more still to come before 2.1.0 is released. Watch this space!

" } }, ] }