fix(editor): Upgrade vue-i18n to latest version (no-changelog) (#14130)

This commit is contained in:
Alex Grozav
2025-03-26 15:20:43 +02:00
committed by GitHub
parent c9b806d30b
commit ee64fdc5cb
11 changed files with 51 additions and 75 deletions

View File

@@ -253,7 +253,7 @@ onMounted(async () => {
i18n.baseText('projects.move.resource.modal.message.sharingInfo', {
adjustToNumber: props.data.resource.sharedWithProjects?.length,
interpolate: {
numberOfProjects: props.data.resource.sharedWithProjects?.length ?? 0,
count: props.data.resource.sharedWithProjects?.length ?? 0,
},
})
}}</span
@@ -271,7 +271,7 @@ onMounted(async () => {
{{
i18n.baseText('projects.move.resource.modal.message.usedCredentials.number', {
adjustToNumber: shareableCredentials.length,
interpolate: { number: shareableCredentials.length },
interpolate: { count: shareableCredentials.length },
})
}}
</span>

View File

@@ -30,7 +30,7 @@ const goToUpgrade = async () => {
{{
locale.baseText('projects.create.limit', {
adjustToNumber: props.limit,
interpolate: { num: String(props.limit) },
interpolate: { count: String(props.limit) },
})
}}
</template>

View File

@@ -1572,7 +1572,7 @@ defineExpose({ enterEditMode });
{{
i18n.baseText('ndv.search.items', {
adjustToNumber: unfilteredDataCount,
interpolate: { matched: dataCount, total: unfilteredDataCount },
interpolate: { matched: dataCount, count: unfilteredDataCount },
})
}}
</N8nText>

View File

@@ -375,7 +375,7 @@ const goToUpgrade = () => {
{{
i18n.baseText('executionsList.selectAll', {
adjustToNumber: total,
interpolate: { executionNum: `${total}` },
interpolate: { count: `${total}` },
})
}}
</th>

View File

@@ -204,7 +204,6 @@ export const useGlobalEntityCreation = () => {
const projectsLimitReachedMessage = computed(() => {
if (settingsStore.isCloudDeployment) {
return i18n.baseText('projects.create.limitReached.cloud', {
adjustToNumber: projectsStore.teamProjectsLimit,
interpolate: {
planName: cloudPlanStore.currentPlanData?.displayName ?? '',
limit: projectsStore.teamProjectsLimit,
@@ -221,7 +220,6 @@ export const useGlobalEntityCreation = () => {
}
return i18n.baseText('projects.create.limitReached', {
adjustToNumber: projectsStore.teamProjectsLimit,
interpolate: {
limit: projectsStore.teamProjectsLimit,
},

View File

@@ -66,11 +66,12 @@ export class I18nClass {
return this.baseTextCache.get(cacheKey) ?? key;
}
const interpolate = { ...options?.interpolate };
let result: string;
if (options?.adjustToNumber !== undefined) {
result = this.i18n.tc(key, options.adjustToNumber, options?.interpolate ?? {}).toString();
result = this.i18n.t(key, interpolate, options.adjustToNumber).toString();
} else {
result = this.i18n.t(key, options?.interpolate ?? {}).toString();
result = this.i18n.t(key, interpolate).toString();
}
// Store the result in the cache

View File

@@ -772,7 +772,7 @@
"executionsList.selectStatus": "Select Status",
"executionsList.selectWorkflow": "Select Workflow",
"executionsList.selected": "{count} execution selected: | {count} executions selected:",
"executionsList.selectAll": "Select {executionNum} finished execution | Select all {executionNum} finished executions",
"executionsList.selectAll": "Select {count} finished execution | Select all {count} finished executions",
"executionsList.test": "Test execution",
"executionsList.evaluation": "Evaluation execution",
"executionsList.showError.handleDeleteSelected.title": "Problem deleting executions",
@@ -2255,7 +2255,7 @@
"ndv.search.noMatch.description.link": "clearing",
"ndv.search.noMatchSchema.description": "To search field values, switch to table or JSON view. {link}",
"ndv.search.noMatchSchema.description.link": "Clear filter",
"ndv.search.items": "{matched} of {total} item | {matched} of {total} items",
"ndv.search.items": "{matched} of {count} item | {matched} of {count} items",
"updatesPanel.andIs": "and is",
"updatesPanel.behindTheLatest": "behind the latest and greatest n8n",
"updatesPanel.howToUpdateYourN8nVersion": "How to update your n8n version",
@@ -2731,7 +2731,7 @@
"projects.sharing.select.placeholder.user": "Share with user(s)",
"projects.sharing.select.placeholder.project": "Share with projects or users",
"projects.error.title": "Project error",
"projects.create.limit": "{num} project | {num} projects",
"projects.create.limit": "{count} project | {count} projects",
"projects.create.limitReached": "You have reached the {planName} plan limit of {limit}. Upgrade your plan to unlock more projects. {link}",
"projects.create.limitReached.cloud": "You have reached the {planName} plan limit of {limit}. Upgrade your plan to unlock more projects.",
"projects.create.limitReached.self": "Upgrade to unlock projects for more granular control over sharing, access and organisation of workflows",
@@ -2743,9 +2743,9 @@
"projects.move.resource.modal.message.personal": "owned by \"{resourceHomeProjectName}\".",
"projects.move.resource.modal.message.note": "Note",
"projects.move.resource.modal.message.sharingNote": "{note}: Moving will remove any existing sharing for this {resourceTypeLabel}.",
"projects.move.resource.modal.message.sharingInfo": "(Currently shared with {numberOfProjects} project) | (Currently shared with {numberOfProjects} projects)",
"projects.move.resource.modal.message.sharingInfo": "(Currently shared with {count} project) | (Currently shared with {count} projects)",
"projects.move.resource.modal.message.usedCredentials": "Also share the {usedCredentials} used by this workflow to ensure it will continue to run correctly",
"projects.move.resource.modal.message.usedCredentials.number": "{number} credential | {number} credentials",
"projects.move.resource.modal.message.usedCredentials.number": "{count} credential | {count} credentials",
"projects.move.resource.modal.message.unAccessibleCredentials": "Some credentials",
"projects.move.resource.modal.message.unAccessibleCredentials.note": "{credentials} used in this workflow will not be shared",
"projects.move.resource.modal.message.noProjects": "Currently there are not any projects or users available for you to move this {resourceTypeLabel} to.",

View File

@@ -16,6 +16,7 @@ import { useSettingsStore } from '@/stores/settings.store';
import { createFormEventBus } from '@n8n/design-system/utils';
import type { MfaModalEvents } from '@/event-bus/mfa';
import { promptMfaCodeBus } from '@/event-bus/mfa';
import type { BaseTextKey } from '@/plugins/i18n';
type UserBasicDetailsForm = {
firstName: string;
@@ -36,7 +37,7 @@ const formInputs = ref<null | IFormInputs>(null);
const formBus = createFormEventBus();
const readyToSubmit = ref(false);
const currentSelectedTheme = ref(useUIStore().theme);
const themeOptions = ref<Array<{ name: ThemeOption; label: string }>>([
const themeOptions = ref<Array<{ name: ThemeOption; label: BaseTextKey }>>([
{
name: 'system',
label: 'settings.personal.theme.systemDefault',
@@ -345,7 +346,7 @@ onBeforeUnmount(() => {
<n8n-option
v-for="item in themeOptions"
:key="item.name"
:label="$t(item.label)"
:label="i18n.baseText(item.label)"
:value="item.name"
>
</n8n-option>

View File

@@ -103,9 +103,10 @@ const testRunErrorDictionary: Partial<Record<TestRunErrorCode, BaseTextKey>> = {
EVALUATION_WORKFLOW_NOT_FOUND: 'testDefinition.listRuns.error.evaluationWorkflowNotFound',
} as const;
const getErrorBaseKey = (errorCode?: string) =>
const getErrorBaseKey = (errorCode?: string): string =>
testCaseErrorDictionary[errorCode as TestCaseExecutionErrorCodes] ??
testRunErrorDictionary[errorCode as TestRunErrorCode];
testRunErrorDictionary[errorCode as TestRunErrorCode] ??
'';
const getErrorTooltipLinkRoute = (row: TestCaseExecutionRecord) => {
if (row.errorCode === TEST_CASE_EXECUTION_ERROR_CODE.FAILED_TO_EXECUTE_EVALUATION_WORKFLOW) {