diff --git a/mailpoet/lib/API/MP/v1/Subscribers.php b/mailpoet/lib/API/MP/v1/Subscribers.php index 995c3cdc4b..c3eda904f9 100644 --- a/mailpoet/lib/API/MP/v1/Subscribers.php +++ b/mailpoet/lib/API/MP/v1/Subscribers.php @@ -395,30 +395,30 @@ class Subscribers { if ($foundSegment->getType() === SegmentEntity::TYPE_WP_USERS) { if ($context === self::CONTEXT_SUBSCRIBE) { // translators: %d is the ID of the segment - $message = __("Can't subscribe to a WordPress Users list with ID %d.", 'mailpoet'); + $message = __("Can't subscribe to a WordPress Users list with ID '%d'.", 'mailpoet'); } else { // translators: %d is the ID of the segment - $message = __("Can't unsubscribe from a WordPress Users list with ID %d.", 'mailpoet'); + $message = __("Can't unsubscribe from a WordPress Users list with ID '%d'.", 'mailpoet'); } throw new APIException(sprintf($message, $foundSegment->getId()), APIException::SUBSCRIBING_TO_WP_LIST_NOT_ALLOWED); } if ($foundSegment->getType() === SegmentEntity::TYPE_WC_USERS) { if ($context === self::CONTEXT_SUBSCRIBE) { // translators: %d is the ID of the segment - $message = __("Can't subscribe to a WooCommerce Customers list with ID %d.", 'mailpoet'); + $message = __("Can't subscribe to a WooCommerce Customers list with ID '%d'.", 'mailpoet'); } else { // translators: %d is the ID of the segment - $message = __("Can't unsubscribe from a WooCommerce Customers list with ID %d.", 'mailpoet'); + $message = __("Can't unsubscribe from a WooCommerce Customers list with ID '%d'.", 'mailpoet'); } throw new APIException(sprintf($message, $foundSegment->getId()), APIException::SUBSCRIBING_TO_WC_LIST_NOT_ALLOWED); } if ($foundSegment->getType() !== SegmentEntity::TYPE_DEFAULT) { if ($context === self::CONTEXT_SUBSCRIBE) { // translators: %d is the ID of the segment - $message = __("Can't subscribe to a list with ID %d.", 'mailpoet'); + $message = __("Can't subscribe to a list with ID '%d'.", 'mailpoet'); } else { // translators: %d is the ID of the segment - $message = __("Can't unsubscribe from a list with ID %d.", 'mailpoet'); + $message = __("Can't unsubscribe from a list with ID '%d'.", 'mailpoet'); } throw new APIException(sprintf($message, $foundSegment->getId()), APIException::SUBSCRIBING_TO_LIST_NOT_ALLOWED); } @@ -430,7 +430,7 @@ class Subscribers { $missingIds = array_values(array_diff($listIds, $foundSegmentsIds)); $exception = sprintf( // translators: %s is the count of lists - _n('List with ID %s does not exist.', 'Lists with IDs %s do not exist.', count($missingIds), 'mailpoet'), + _n("List with ID '%s' does not exist.", "Lists with IDs '%s' do not exist.", count($missingIds), 'mailpoet'), implode(', ', $missingIds) ); throw new APIException(sprintf($exception, implode(', ', $missingIds)), APIException::LIST_NOT_EXISTS); diff --git a/mailpoet/lib/Automation/Integrations/MailPoet/Subjects/NewsletterLinkSubject.php b/mailpoet/lib/Automation/Integrations/MailPoet/Subjects/NewsletterLinkSubject.php index c0684509a5..7fe0a00ee8 100644 --- a/mailpoet/lib/Automation/Integrations/MailPoet/Subjects/NewsletterLinkSubject.php +++ b/mailpoet/lib/Automation/Integrations/MailPoet/Subjects/NewsletterLinkSubject.php @@ -56,7 +56,7 @@ class NewsletterLinkSubject implements Subject { $linkId = $subjectData->getArgs()['link_id']; $linkEntity = $this->newsletterLinkRepository->findOneById($linkId); if (!$linkEntity) { - throw NotFoundException::create()->withMessage(sprintf('Email link with ID %d not found', $linkId)); + throw NotFoundException::create()->withMessage(sprintf("Email link with ID '%d' not found", $linkId)); } return new NewsletterLinkPayload($linkEntity); diff --git a/mailpoet/lib/Segments/SegmentsRepository.php b/mailpoet/lib/Segments/SegmentsRepository.php index b064a4a2f4..f5fad71795 100644 --- a/mailpoet/lib/Segments/SegmentsRepository.php +++ b/mailpoet/lib/Segments/SegmentsRepository.php @@ -153,10 +153,10 @@ class SegmentsRepository extends Repository { try { $dynamicSegment = $this->findOneById($id); if (!$dynamicSegment instanceof SegmentEntity) { - throw InvalidStateException::create()->withMessage(sprintf("Could not find segment with ID %s.", $id)); + throw InvalidStateException::create()->withMessage(sprintf("Could not find segment with ID '%s'.", $id)); } if ($dynamicSegment->getType() !== SegmentEntity::TYPE_DYNAMIC) { - throw InvalidStateException::create()->withMessage(sprintf("Segment with ID %s is not a dynamic segment. Its type is %s.", $id, $dynamicSegment->getType())); + throw InvalidStateException::create()->withMessage(sprintf("Segment with ID '%s' is not a dynamic segment. Its type is %s.", $id, $dynamicSegment->getType())); } } catch (InvalidStateException $exception) { $this->loggerFactory->getLogger(LoggerFactory::TOPIC_SEGMENTS)->error(sprintf("Could not verify existence of dynamic segment: %s", $exception->getMessage()));