mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(editor): Extract @n8n/i18n package for internationalization (no-changelog) (#15466)
This commit is contained in:
@@ -50,7 +50,7 @@ import {
|
||||
|
||||
import { useDebounce } from '@/composables/useDebounce';
|
||||
import { useExternalHooks } from '@/composables/useExternalHooks';
|
||||
import { useI18n } from '@/composables/useI18n';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
||||
import { useTelemetry } from '@/composables/useTelemetry';
|
||||
import { useWorkflowHelpers } from '@/composables/useWorkflowHelpers';
|
||||
@@ -70,6 +70,7 @@ import { captureMessage } from '@sentry/vue';
|
||||
import { completeExpressionSyntax, shouldConvertToExpression } from '@/utils/expressions';
|
||||
import { isPresent } from '@/utils/typesUtils';
|
||||
import CssEditor from './CssEditor/CssEditor.vue';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
|
||||
type Picker = { $emit: (arg0: string, arg1: Date) => void };
|
||||
|
||||
@@ -132,6 +133,7 @@ const ndvStore = useNDVStore();
|
||||
const workflowsStore = useWorkflowsStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
const nodeTypesStore = useNodeTypesStore();
|
||||
const uiStore = useUIStore();
|
||||
|
||||
// ESLint: false positive
|
||||
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents, @typescript-eslint/no-duplicate-type-constituents
|
||||
@@ -619,20 +621,24 @@ function skipCheck(value: string | number | boolean | null) {
|
||||
|
||||
function getPlaceholder(): string {
|
||||
return props.isForCredential
|
||||
? i18n.credText().placeholder(props.parameter)
|
||||
: i18n.nodeText().placeholder(props.parameter, props.path);
|
||||
? i18n.credText(uiStore.activeCredentialType).placeholder(props.parameter)
|
||||
: i18n.nodeText(ndvStore.activeNode?.type).placeholder(props.parameter, props.path);
|
||||
}
|
||||
|
||||
function getOptionsOptionDisplayName(option: INodePropertyOptions): string {
|
||||
return props.isForCredential
|
||||
? i18n.credText().optionsOptionDisplayName(props.parameter, option)
|
||||
: i18n.nodeText().optionsOptionDisplayName(props.parameter, option, props.path);
|
||||
? i18n.credText(uiStore.activeCredentialType).optionsOptionDisplayName(props.parameter, option)
|
||||
: i18n
|
||||
.nodeText(ndvStore.activeNode?.type)
|
||||
.optionsOptionDisplayName(props.parameter, option, props.path);
|
||||
}
|
||||
|
||||
function getOptionsOptionDescription(option: INodePropertyOptions): string {
|
||||
return props.isForCredential
|
||||
? i18n.credText().optionsOptionDescription(props.parameter, option)
|
||||
: i18n.nodeText().optionsOptionDescription(props.parameter, option, props.path);
|
||||
? i18n.credText(uiStore.activeCredentialType).optionsOptionDescription(props.parameter, option)
|
||||
: i18n
|
||||
.nodeText(ndvStore.activeNode?.type)
|
||||
.optionsOptionDescription(props.parameter, option, props.path);
|
||||
}
|
||||
|
||||
async function loadRemoteParameterOptions() {
|
||||
@@ -1274,7 +1280,7 @@ onUpdated(async () => {
|
||||
:model-value="codeEditDialogVisible"
|
||||
:append-to="`#${APP_MODALS_ELEMENT_ID}`"
|
||||
:title="`${i18n.baseText('codeEdit.edit')} ${i18n
|
||||
.nodeText()
|
||||
.nodeText(ndvStore.activeNode?.type)
|
||||
.inputLabelDisplayName(parameter, path)}`"
|
||||
:before-close="closeCodeEditDialog"
|
||||
data-test-id="code-editor-fullscreen"
|
||||
|
||||
Reference in New Issue
Block a user