From aa18c65fa82371affec9ea08947bebdc3d474938 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 7 May 2015 14:06:55 +0100 Subject: [PATCH] NLS enable the Inject node --- editor/js/ui/editor.js | 9 ++- nodes/core/core/20-inject.html | 101 ++++++++++++++----------- nodes/core/locales/en-US/messages.json | 48 +++++++++++- 3 files changed, 110 insertions(+), 48 deletions(-) diff --git a/editor/js/ui/editor.js b/editor/js/ui/editor.js index ab4d3658a..740ba58a8 100644 --- a/editor/js/ui/editor.js +++ b/editor/js/ui/editor.js @@ -583,7 +583,14 @@ RED.editor = (function() { $("#dialog-form").find('[data-i18n]').each(function() { var current = $(this).attr("data-i18n"); if (current.indexOf(":") === -1) { - $(this).attr("data-i18n",ns+":"+current); + var prefix = ""; + if (current.indexOf("[")===0) { + var parts = current.split("]"); + prefix = parts[0]+"]"; + current = parts[1]; + } + + $(this).attr("data-i18n",prefix+ns+":"+current); } }); $('').appendTo("#dialog-form"); diff --git a/nodes/core/core/20-inject.html b/nodes/core/core/20-inject.html index 6e9b22f9c..c1a1c0dcd 100644 --- a/nodes/core/core/20-inject.html +++ b/nodes/core/core/20-inject.html @@ -16,38 +16,47 @@