Update user friendly errors for translations (#15000)

Force msg typing instead of string for user friendly errors
This commit is contained in:
Félix Malfait
2025-10-09 18:17:32 +02:00
committed by GitHub
parent 660cd38f35
commit e577c2d746
124 changed files with 796 additions and 563 deletions
@@ -1,4 +1,4 @@
import { t } from '@lingui/core/macro';
import { msg } from '@lingui/core/macro';
import {
WorkflowQueryValidationException,
@@ -14,7 +14,7 @@ export const assertWorkflowStatusesNotSet = (
'Statuses cannot be set manually.',
WorkflowQueryValidationExceptionCode.FORBIDDEN,
{
userFriendlyMessage: t`Statuses cannot be set manually.`,
userFriendlyMessage: msg`Statuses cannot be set manually.`,
},
);
}
@@ -1,4 +1,4 @@
import { t } from '@lingui/core/macro';
import { msg } from '@lingui/core/macro';
import { type WorkflowVersionWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-version.workspace-entity';
import { type WorkflowAction } from 'src/modules/workflow/workflow-executor/workflow-actions/types/workflow-action.type';
@@ -17,7 +17,7 @@ export function assertWorkflowVersionHasSteps(
'Workflow version does not contain at least one step',
WorkflowTriggerExceptionCode.INVALID_WORKFLOW_VERSION,
{
userFriendlyMessage: t`Workflow version does not contain at least one step`,
userFriendlyMessage: msg`Workflow version does not contain at least one step`,
},
);
}
@@ -1,4 +1,4 @@
import { t } from '@lingui/core/macro';
import { msg } from '@lingui/core/macro';
import {
WorkflowQueryValidationException,
@@ -17,7 +17,7 @@ export const assertWorkflowVersionIsDraft = (
'Workflow version is not in draft status',
WorkflowQueryValidationExceptionCode.FORBIDDEN,
{
userFriendlyMessage: t`Workflow version is not in draft status`,
userFriendlyMessage: msg`Workflow version is not in draft status`,
},
);
}
@@ -1,4 +1,4 @@
import { t } from '@lingui/core/macro';
import { msg } from '@lingui/core/macro';
import { type WorkflowVersionWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-version.workspace-entity';
import {
@@ -20,7 +20,7 @@ export function assertWorkflowVersionTriggerIsDefined(
'Workflow version does not contain trigger',
WorkflowTriggerExceptionCode.INVALID_WORKFLOW_VERSION,
{
userFriendlyMessage: t`Workflow version does not contain trigger`,
userFriendlyMessage: msg`Workflow version does not contain trigger`,
},
);
}
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { t } from '@lingui/core/macro';
import { msg } from '@lingui/core/macro';
import { IsNull, Not } from 'typeorm';
import {
@@ -40,7 +40,7 @@ export class WorkflowVersionValidationWorkspaceService {
'Cannot create workflow version with status other than draft',
WorkflowQueryValidationExceptionCode.FORBIDDEN,
{
userFriendlyMessage: t`Cannot create workflow version with status other than draft`,
userFriendlyMessage: msg`Cannot create workflow version with status other than draft`,
},
);
}
@@ -67,7 +67,7 @@ export class WorkflowVersionValidationWorkspaceService {
'Cannot create multiple draft versions for the same workflow',
WorkflowQueryValidationExceptionCode.FORBIDDEN,
{
userFriendlyMessage: t`Cannot create multiple draft versions for the same workflow`,
userFriendlyMessage: msg`Cannot create multiple draft versions for the same workflow`,
},
);
}
@@ -97,7 +97,7 @@ export class WorkflowVersionValidationWorkspaceService {
'Cannot update workflow version status manually',
WorkflowQueryValidationExceptionCode.FORBIDDEN,
{
userFriendlyMessage: t`Cannot update workflow version status manually`,
userFriendlyMessage: msg`Cannot update workflow version status manually`,
},
);
}
@@ -143,7 +143,7 @@ export class WorkflowVersionValidationWorkspaceService {
'The initial version of a workflow can not be deleted',
WorkflowQueryValidationExceptionCode.FORBIDDEN,
{
userFriendlyMessage: t`The initial version of a workflow can not be deleted`,
userFriendlyMessage: msg`The initial version of a workflow can not be deleted`,
},
);
}