From 7cb8f97ef1f7e37d801e0f12d2c7565eba80d5c0 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 1 Dec 2021 15:08:04 +0000 Subject: [PATCH 1/2] Fix i18n handling of namespaces with spaces in --- packages/node_modules/@node-red/editor-client/src/js/i18n.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/node_modules/@node-red/editor-client/src/js/i18n.js b/packages/node_modules/@node-red/editor-client/src/js/i18n.js index 028321ce9..b8c03b85b 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/i18n.js +++ b/packages/node_modules/@node-red/editor-client/src/js/i18n.js @@ -38,6 +38,8 @@ RED.i18n = (function() { defaultNS: "editor", fallbackLng: ['en-US'], returnObjects: true, + keySeparator: ".", + nsSeparator: ":", interpolation: { unescapeSuffix: 'HTML', escapeValue: false, From 33af5cd7c6af3d2001de37ee4077e09d5ebf0621 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 1 Dec 2021 15:15:08 +0000 Subject: [PATCH 2/2] Apply i18n namespace fix to runtime component --- packages/node_modules/@node-red/util/lib/i18n.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/util/lib/i18n.js b/packages/node_modules/@node-red/util/lib/i18n.js index cddcb764f..4f1cf110f 100644 --- a/packages/node_modules/@node-red/util/lib/i18n.js +++ b/packages/node_modules/@node-red/util/lib/i18n.js @@ -136,8 +136,6 @@ function getCurrentLocale() { function init(settings) { if (!initPromise) { - // Keep this as a 'when' promise as top-level red.js uses 'otherwise' - // and embedded users of NR may have copied that. initPromise = new Promise((resolve,reject) => { i18n.use(MessageFileLoader); var opt = { @@ -146,6 +144,8 @@ function init(settings) { defaultNS: "runtime", ns: [], fallbackLng: defaultLang, + keySeparator: ".", + nsSeparator: ":", interpolation: { unescapeSuffix: 'HTML', escapeValue: false,