From d3519e44d0534a3d8b6c941d6149ed04d8ff1aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 23 Nov 2021 12:14:13 +0100 Subject: [PATCH] :zap: Account for multiple headers in single translation file --- packages/nodes-base/gulpfile.js | 21 +++++++++++-------- .../nodes/Github/translations/de.ts | 6 ++++++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/packages/nodes-base/gulpfile.js b/packages/nodes-base/gulpfile.js index 495ca8d1c7..daa23fbc94 100644 --- a/packages/nodes-base/gulpfile.js +++ b/packages/nodes-base/gulpfile.js @@ -85,18 +85,21 @@ function getTranslationPaths() { function getHeadersAndTranslations(paths) { return paths.reduce((acc, cur) => { const translation = require(cur.source); - const nodeType = Object.keys(translation).pop(); - const { header } = translation[nodeType]; + const nodeTypes = Object.keys(translation); - if (isValidHeader(header, ALLOWED_HEADER_KEYS)) { - acc.headers[nodeType] = header; + for (const nodeType of nodeTypes) { + const { header } = translation[nodeType]; + + if (isValidHeader(header, ALLOWED_HEADER_KEYS)) { + acc.headers[nodeType] = header; + } + + acc.translations.push({ + destinationPath: cur.destination, + content: translation, + }); } - acc.translations.push({ - destinationPath: cur.destination, - content: translation, - }); - return acc; }, { headers: {}, translations: [] }); } diff --git a/packages/nodes-base/nodes/Github/translations/de.ts b/packages/nodes-base/nodes/Github/translations/de.ts index d6a95db337..4a2d4c252e 100644 --- a/packages/nodes-base/nodes/Github/translations/de.ts +++ b/packages/nodes-base/nodes/Github/translations/de.ts @@ -1,4 +1,10 @@ module.exports = { + githubTrigger: { + header: { + displayName: '🇩🇪 GitHub Trigger', + description: '🇩🇪 Listen to GitHub events', + }, + }, github: { header: { displayName: '🇩🇪 GitHub',