refactor(editor): Extract @n8n/i18n package for internationalization (no-changelog) (#15466)

This commit is contained in:
Alex Grozav
2025-05-30 11:44:33 +02:00
committed by GitHub
parent bbe2b12bf2
commit e704077864
408 changed files with 1002 additions and 767 deletions

View File

@@ -4,12 +4,14 @@ import { get } from 'lodash-es';
import type { INodeParameters, INodeProperties } from 'n8n-workflow';
import { deepCopy } from 'n8n-workflow';
import { useI18n } from '@/composables/useI18n';
import { useI18n } from '@n8n/i18n';
import type { IUpdateInformation } from '@/Interface';
import CollectionParameter from '@/components/CollectionParameter.vue';
import ParameterInputFull from '@/components/ParameterInputFull.vue';
import { N8nButton, N8nInputLabel, N8nText } from '@n8n/design-system';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { useNDVStore } from '@/stores/ndv.store';
import { storeToRefs } from 'pinia';
defineOptions({ name: 'MultipleParameter' });
@@ -31,8 +33,11 @@ const emit = defineEmits<{
valueChanged: [parameterData: IUpdateInformation];
}>();
const ndvStore = useNDVStore();
const i18n = useI18n();
const { activeNode } = storeToRefs(ndvStore);
const mutableValues = ref<INodeParameters[]>(deepCopy(props.values));
watch(
@@ -48,7 +53,7 @@ const addButtonText = computed(() => {
return i18n.baseText('multipleParameter.addItem');
}
return i18n.nodeText().multipleValueButtonText(props.parameter);
return i18n.nodeText(activeNode.value?.type).multipleValueButtonText(props.parameter);
});
const hideDelete = computed(() => props.parameter.options?.length === 1);
@@ -108,8 +113,8 @@ const valueChanged = (parameterData: IUpdateInformation) => {
<template>
<div class="duplicate-parameter" @keydown.stop>
<N8nInputLabel
:label="i18n.nodeText().inputLabelDisplayName(parameter, path)"
:tooltip-text="i18n.nodeText().inputLabelDescription(parameter, path)"
:label="i18n.nodeText(activeNode?.type).inputLabelDisplayName(parameter, path)"
:tooltip-text="i18n.nodeText(activeNode?.type).inputLabelDescription(parameter, path)"
:underline="true"
size="small"
color="text-dark"