mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #2334 from kazuhitoyokoi/master-fixsubflowlang2
Fix language handling in subflow node
This commit is contained in:
commit
f9b147af42
@ -802,16 +802,16 @@ RED.subflow = (function() {
|
||||
}
|
||||
$("<option/>", opt).text(item.text).appendTo(locales);
|
||||
});
|
||||
currentLocale = RED.i18n.lang();
|
||||
locales.val(currentLocale);
|
||||
var locale = RED.i18n.lang();
|
||||
locales.val(locale);
|
||||
|
||||
locales.on("change", function() {
|
||||
var locale = $(this).val();
|
||||
currentLocale = $(this).val();
|
||||
var items = $("#node-input-env-container").editableList("items");
|
||||
items.each(function (i, item) {
|
||||
var entry = $(this).data('data');
|
||||
var labelField = entry.ui.labelField;
|
||||
labelField.val(lookupLabel(entry.ui.label, "", locale));
|
||||
labelField.val(lookupLabel(entry.ui.label, "", currentLocale));
|
||||
if (labelField.timeout) {
|
||||
clearTimeout(labelField.timeout);
|
||||
delete labelField.timeout;
|
||||
@ -1371,7 +1371,8 @@ RED.subflow = (function() {
|
||||
}
|
||||
|
||||
var labels = ui.label || {};
|
||||
var labelText = lookupLabel(labels, labels["en-US"]||tenv.name, currentLocale);
|
||||
var locale = RED.i18n.lang();
|
||||
var labelText = lookupLabel(labels, labels["en-US"]||tenv.name, locale);
|
||||
var label = $('<label>').appendTo(row);
|
||||
var labelContainer = $('<span></span>').appendTo(label);
|
||||
if (ui.icon) {
|
||||
@ -1423,7 +1424,7 @@ RED.subflow = (function() {
|
||||
input = $('<select>').css('width','70%').appendTo(row);
|
||||
if (ui.opts.opts) {
|
||||
ui.opts.opts.forEach(function(o) {
|
||||
$('<option>').val(o.v).text(lookupLabel(o.l, o.l['en-US']||o.v, currentLocale)).appendTo(input);
|
||||
$('<option>').val(o.v).text(lookupLabel(o.l, o.l['en-US']||o.v, locale)).appendTo(input);
|
||||
})
|
||||
}
|
||||
input.val(val.value);
|
||||
|
Loading…
Reference in New Issue
Block a user