Use "automation" instead of "workflow" in user-facing strings

[MAILPOET-4758]
This commit is contained in:
Jan Jakes
2022-11-02 21:29:35 +01:00
committed by David Remer
parent ccb5369c57
commit dc5e5b4f8b
39 changed files with 88 additions and 88 deletions

View File

@ -63,50 +63,50 @@ class Exceptions {
public static function workflowNotFound(int $id): NotFoundException {
return NotFoundException::create()
->withErrorCode(self::WORKFLOW_NOT_FOUND)
// translators: %d is the ID of the workflow.
->withMessage(sprintf(__("Workflow with ID '%d' not found.", 'mailpoet'), $id));
// translators: %d is the ID of the automation.
->withMessage(sprintf(__("Automation with ID '%d' not found.", 'mailpoet'), $id));
}
public static function workflowVersionNotFound(int $workflow, int $version): NotFoundException {
return NotFoundException::create()
->withErrorCode(self::WORKFLOW_VERSION_NOT_FOUND)
// translators: %1$s is the ID of the workflow, %2$s the version.
->withMessage(sprintf(__('Workflow with ID "%1$s" in version "%2$s" not found.', 'mailpoet'), $workflow, $version));
// translators: %1$s is the ID of the automation, %2$s the version.
->withMessage(sprintf(__('Automation with ID "%1$s" in version "%2$s" not found.', 'mailpoet'), $workflow, $version));
}
public static function workflowNotActive(int $workflow): InvalidStateException {
return InvalidStateException::create()
->withErrorCode(self::WORKFLOW_NOT_ACTIVE)
// translators: %1$s is the ID of the workflow.
->withMessage(sprintf(__('Workflow with ID "%1$s" in no longer active.', 'mailpoet'), $workflow));
// translators: %1$s is the ID of the automation.
->withMessage(sprintf(__('Automation with ID "%1$s" in no longer active.', 'mailpoet'), $workflow));
}
public static function workflowRunNotFound(int $id): NotFoundException {
return NotFoundException::create()
->withErrorCode(self::WORKFLOW_RUN_NOT_FOUND)
// translators: %d is the ID of the workflow run.
->withMessage(sprintf(__("Workflow run with ID '%d' not found.", 'mailpoet'), $id));
// translators: %d is the ID of the automation run.
->withMessage(sprintf(__("Automation run with ID '%d' not found.", 'mailpoet'), $id));
}
public static function workflowStepNotFound(string $key): NotFoundException {
return NotFoundException::create()
->withErrorCode(self::WORKFLOW_STEP_NOT_FOUND)
// translators: %s is the key of the workflow step.
->withMessage(sprintf(__("Workflow step with key '%s' not found.", 'mailpoet'), $key));
// translators: %s is the key of the automation step.
->withMessage(sprintf(__("Automation step with key '%s' not found.", 'mailpoet'), $key));
}
public static function workflowTriggerNotFound(int $workflowId, string $key): NotFoundException {
return NotFoundException::create()
->withErrorCode(self::WORKFLOW_TRIGGER_NOT_FOUND)
// translators: %1$s is the key, %2$d is the workflow ID.
->withMessage(sprintf(__('Workflow trigger with key "%1$s" not found in workflow ID "%2$d".', 'mailpoet'), $key, $workflowId));
// translators: %1$s is the key, %2$d is the automation ID.
->withMessage(sprintf(__('Automation trigger with key "%1$s" not found in automation ID "%2$d".', 'mailpoet'), $key, $workflowId));
}
public static function workflowRunNotRunning(int $id, string $status): InvalidStateException {
return InvalidStateException::create()
->withErrorCode(self::WORKFLOW_RUN_NOT_RUNNING)
// translators: %1$d is the ID of the workflow run, %2$s its current status.
->withMessage(sprintf(__('Workflow run with ID "%1$d" is not running. Status: %2$s', 'mailpoet'), $id, $status));
// translators: %1$d is the ID of the automation run, %2$s its current status.
->withMessage(sprintf(__('Automation run with ID "%1$d" is not running. Status: %2$s', 'mailpoet'), $id, $status));
}
public static function subjectNotFound(string $key): NotFoundException {
@ -133,50 +133,50 @@ class Exceptions {
public static function subjectDataNotFound(string $key, int $workflowRunId): NotFoundException {
return NotFoundException::create()
->withErrorCode(self::SUBJECT_DATA_NOT_FOUND)
// translators: %1$s is the key of the subject, %2$d is workflow run ID.
// translators: %1$s is the key of the subject, %2$d is automation run ID.
->withMessage(
sprintf(__("Subject data for subject with key '%1\$s' not found for workflow run with ID '%2\$d'.", 'mailpoet'), $key, $workflowRunId)
sprintf(__("Subject data for subject with key '%1\$s' not found for automation run with ID '%2\$d'.", 'mailpoet'), $key, $workflowRunId)
);
}
public static function multipleSubjectsFound(string $key, int $workflowRunId): InvalidStateException {
return InvalidStateException::create()
->withErrorCode(self::MULTIPLE_SUBJECTS_FOUND)
// translators: %1$s is the key of the subject, %2$d is workflow run ID.
// translators: %1$s is the key of the subject, %2$d is automation run ID.
->withMessage(
sprintf(__("Multiple subjects with key '%1\$s' found for workflow run with ID '%2\$d', only one expected.", 'mailpoet'), $key, $workflowRunId)
sprintf(__("Multiple subjects with key '%1\$s' found for automation run with ID '%2\$d', only one expected.", 'mailpoet'), $key, $workflowRunId)
);
}
public static function payloadNotFound(string $class, int $workflowRunId): NotFoundException {
return NotFoundException::create()
->withErrorCode(self::PAYLOAD_NOT_FOUND)
// translators: %1$s is the class of the payload, %2$d is workflow run ID.
// translators: %1$s is the class of the payload, %2$d is automation run ID.
->withMessage(
sprintf(__("Payload of class '%1\$s' not found for workflow run with ID '%2\$d'.", 'mailpoet'), $class, $workflowRunId)
sprintf(__("Payload of class '%1\$s' not found for automation run with ID '%2\$d'.", 'mailpoet'), $class, $workflowRunId)
);
}
public static function multiplePayloadsFound(string $class, int $workflowRunId): NotFoundException {
return NotFoundException::create()
->withErrorCode(self::MULTIPLE_PAYLOADS_FOUND)
// translators: %1$s is the class of the payloads, %2$d is workflow run ID.
// translators: %1$s is the class of the payloads, %2$d is automation run ID.
->withMessage(
sprintf(__("Multiple payloads of class '%1\$s' found for workflow run with ID '%2\$d'.", 'mailpoet'), $class, $workflowRunId)
sprintf(__("Multiple payloads of class '%1\$s' found for automation run with ID '%2\$d'.", 'mailpoet'), $class, $workflowRunId)
);
}
public static function workflowStructureModificationNotSupported(): UnexpectedValueException {
return UnexpectedValueException::create()
->withErrorCode(self::WORKFLOW_STRUCTURE_MODIFICATION_NOT_SUPPORTED)
->withMessage(__("Workflow structure modification not supported.", 'mailpoet'));
->withMessage(__('Automation structure modification not supported.', 'mailpoet'));
}
public static function workflowStructureNotValid(string $detail, string $ruleId): UnexpectedValueException {
return UnexpectedValueException::create()
->withErrorCode(self::WORKFLOW_STRUCTURE_NOT_VALID)
// translators: %s is a detailed information
->withMessage(sprintf(__("Invalid workflow structure: %s", 'mailpoet'), $detail))
->withMessage(sprintf(__("Invalid automation structure: %s", 'mailpoet'), $detail))
->withErrors(['rule_id' => $ruleId]);
}
@ -198,7 +198,7 @@ class Exceptions {
return UnexpectedValueException::create()
->withErrorCode(self::WORKFLOW_NOT_VALID)
// translators: %s is a detailed information
->withMessage(sprintf(__("Workflow validation failed: %s", 'mailpoet'), $detail))
->withMessage(sprintf(__("Automation validation failed: %s", 'mailpoet'), $detail))
->withErrors($errors);
}
@ -218,14 +218,14 @@ class Exceptions {
public static function workflowNotTrashed(int $id): UnexpectedValueException {
return UnexpectedValueException::create()
->withErrorCode(self::WORKFLOW_NOT_TRASHED)
// translators: %d is the ID of the workflow.
->withMessage(sprintf(__("Can't delete workflow with ID '%d' because it was not trashed.", 'mailpoet'), $id));
// translators: %d is the ID of the automation.
->withMessage(sprintf(__("Can't delete automation with ID '%d' because it was not trashed.", 'mailpoet'), $id));
}
public static function workflowTemplateNotFound(string $id): NotFoundException {
return NotFoundException::create()
->withErrorCode(self::WORKFLOW_TEMPLATE_NOT_FOUND)
// translators: %d is the ID of the workflow template.
->withMessage(sprintf(__("Workflow template with ID '%d' not found.", 'mailpoet'), $id));
// translators: %d is the ID of the automation template.
->withMessage(sprintf(__("Automation template with ID '%d' not found.", 'mailpoet'), $id));
}
}