mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
⚡ Account for multiple headers in single translation file
This commit is contained in:
@@ -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: [] });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user