refactor: Move node i18n logic to NodeTypes (no-changelog) (#7035)

This commit is contained in:
Iván Ovejero
2023-08-29 10:46:24 +02:00
committed by GitHub
parent b716241b42
commit 53361d1d62
3 changed files with 46 additions and 50 deletions

View File

@@ -3,7 +3,6 @@ import get from 'lodash/get';
import { Request } from 'express';
import type { INodeTypeDescription, INodeTypeNameVersion } from 'n8n-workflow';
import { Authorized, Post, RestController } from '@/decorators';
import { getNodeTranslationPath } from '@/TranslationHelpers';
import { Config } from '@/config';
import { NodeTypes } from '@/NodeTypes';
@@ -35,7 +34,7 @@ export class NodeTypesController {
nodeTypes: INodeTypeDescription[],
) => {
const { description, sourcePath } = this.nodeTypes.getWithSourcePath(name, version);
const translationPath = await getNodeTranslationPath({
const translationPath = await this.nodeTypes.getNodeTranslationPath({
nodeSourcePath: sourcePath,
longNodeType: description.name,
locale: defaultLocale,