mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
refactor(editor): Extract @n8n/i18n package for internationalization (no-changelog) (#15466)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { IUpdateInformation } from '@/Interface';
|
||||
import { useI18n } from '@/composables/useI18n';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { useTelemetry } from '@/composables/useTelemetry';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { isValueExpression as isValueExpressionUtil } from '@/utils/nodeTypesUtils';
|
||||
@@ -14,6 +14,8 @@ import type {
|
||||
import { computed, ref } from 'vue';
|
||||
import ParameterInputWrapper from './ParameterInputWrapper.vue';
|
||||
import ParameterOptions from './ParameterOptions.vue';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
import { storeToRefs } from 'pinia';
|
||||
|
||||
type Props = {
|
||||
parameter: INodeProperties;
|
||||
@@ -35,12 +37,15 @@ const focused = ref(false);
|
||||
const blurredEver = ref(false);
|
||||
const menuExpanded = ref(false);
|
||||
const eventBus = ref(createEventBus());
|
||||
const uiStore = useUIStore();
|
||||
|
||||
const workflowsStore = useWorkflowsStore();
|
||||
|
||||
const i18n = useI18n();
|
||||
const telemetry = useTelemetry();
|
||||
|
||||
const { activeCredentialType } = storeToRefs(uiStore);
|
||||
|
||||
const showRequiredErrors = computed(() => {
|
||||
if (!props.parameter.required) {
|
||||
return false;
|
||||
@@ -68,7 +73,7 @@ const hint = computed(() => {
|
||||
return null;
|
||||
}
|
||||
|
||||
return i18n.credText().hint(props.parameter);
|
||||
return i18n.credText(activeCredentialType.value).hint(props.parameter);
|
||||
});
|
||||
|
||||
const isValueExpression = computed(() => {
|
||||
@@ -110,8 +115,8 @@ function onDocumentationUrlClick(): void {
|
||||
|
||||
<template>
|
||||
<n8n-input-label
|
||||
:label="i18n.credText().inputLabelDisplayName(parameter)"
|
||||
:tooltip-text="i18n.credText().inputLabelDescription(parameter)"
|
||||
:label="i18n.credText(activeCredentialType).inputLabelDisplayName(parameter)"
|
||||
:tooltip-text="i18n.credText(activeCredentialType).inputLabelDescription(parameter)"
|
||||
:required="parameter.required"
|
||||
:show-tooltip="focused"
|
||||
:show-options="menuExpanded"
|
||||
|
||||
Reference in New Issue
Block a user