From 97e160bf6729a0e513d0a0fcbaef34bf009f35d7 Mon Sep 17 00:00:00 2001 From: David Remer Date: Thu, 4 Aug 2022 13:54:44 +0300 Subject: [PATCH] Fix WordPress.WP.I18n.MissingArgDomain [MAILPOET-4524] --- mailpoet/lib/AdminPages/Pages/Settings.php | 5 +++-- .../MailPoet/Triggers/SegmentSubscribedTrigger.php | 2 +- mailpoet/lib/Config/Renderer.php | 2 +- mailpoet/lib/Cron/Workers/SendingQueue/Migration.php | 2 +- mailpoet/lib/Form/Widget.php | 2 +- mailpoet/lib/Models/Newsletter.php | 2 +- .../lib/Newsletter/Scheduler/AutomationEmailScheduler.php | 2 +- mailpoet/lib/Services/Bridge/API.php | 2 +- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/mailpoet/lib/AdminPages/Pages/Settings.php b/mailpoet/lib/AdminPages/Pages/Settings.php index aa72bac4c8..cfd492e5a6 100644 --- a/mailpoet/lib/AdminPages/Pages/Settings.php +++ b/mailpoet/lib/AdminPages/Pages/Settings.php @@ -106,8 +106,9 @@ class Settings { if (isset($_GET['enable-customizer-notice'])) { $notice = new WPNotice(WPNotice::TYPE_ERROR, _x( 'You need to have WooCommerce active to access the MailPoet email customizer for WooCommerce.', - 'Notice in Settings when WooCommerce is not enabled' - ), 'mailpoet'); + 'Notice in Settings when WooCommerce is not enabled', + 'mailpoet' + )); $notice->displayWPNotice(); } $this->pageRenderer->displayPage('settings.html', $data); diff --git a/mailpoet/lib/Automation/Integrations/MailPoet/Triggers/SegmentSubscribedTrigger.php b/mailpoet/lib/Automation/Integrations/MailPoet/Triggers/SegmentSubscribedTrigger.php index 8d2564f9c6..cccd9491aa 100644 --- a/mailpoet/lib/Automation/Integrations/MailPoet/Triggers/SegmentSubscribedTrigger.php +++ b/mailpoet/lib/Automation/Integrations/MailPoet/Triggers/SegmentSubscribedTrigger.php @@ -27,7 +27,7 @@ class SegmentSubscribedTrigger implements Trigger { } public function getName(): string { - return __('Subscribed to segment'); + return __('Subscribed to segment', 'mailpoet'); } public function getArgsSchema(): ObjectSchema { diff --git a/mailpoet/lib/Config/Renderer.php b/mailpoet/lib/Config/Renderer.php index 6739bb5b53..7caa78f68e 100644 --- a/mailpoet/lib/Config/Renderer.php +++ b/mailpoet/lib/Config/Renderer.php @@ -103,7 +103,7 @@ class Renderer { } catch (\RuntimeException $e) { throw new \Exception(sprintf( // translators: %1$s is the name of the render, %2$s the folder path, %3$s the error message. - __('Failed to render template "%1$s". Please ensure the template cache folder "%2$s" exists and has write permissions. Terminated with error: "%3$s"'), + __('Failed to render template "%1$s". Please ensure the template cache folder "%2$s" exists and has write permissions. Terminated with error: "%3$s"', 'mailpoet'), $template, $this->cachePath, $e->getMessage() diff --git a/mailpoet/lib/Cron/Workers/SendingQueue/Migration.php b/mailpoet/lib/Cron/Workers/SendingQueue/Migration.php index c69d079ab7..8db51ac20b 100644 --- a/mailpoet/lib/Cron/Workers/SendingQueue/Migration.php +++ b/mailpoet/lib/Cron/Workers/SendingQueue/Migration.php @@ -75,7 +75,7 @@ class Migration extends SimpleWorker { $mailerLog = MailerLog::setError( $mailerLog, 'migration', - __('Your sending queue data is being migrated to allow better performance, sending is paused while the migration is in progress and will resume automatically upon completion. This may take a few minutes.') + __('Your sending queue data is being migrated to allow better performance, sending is paused while the migration is in progress and will resume automatically upon completion. This may take a few minutes.', 'mailpoet') ); return MailerLog::pauseSending($mailerLog); } diff --git a/mailpoet/lib/Form/Widget.php b/mailpoet/lib/Form/Widget.php index b2e9a9acc5..85dbfe8ce2 100644 --- a/mailpoet/lib/Form/Widget.php +++ b/mailpoet/lib/Form/Widget.php @@ -150,7 +150,7 @@ class Widget extends \WP_Widget { // Select the first one from the list if none selected if ($selectedForm === 0 && !empty($forms)) $selectedForm = $forms[0]->getId(); foreach ($forms as $form) { - $formName = $form->getName() ? $this->wp->escHtml($form->getName()) : '(' . _x('no name', 'fallback for forms without a name in a form list') . ')'; + $formName = $form->getName() ? $this->wp->escHtml($form->getName()) : '(' . _x('no name', 'fallback for forms without a name in a form list', 'mailpoet') . ')'; $formName .= $form->getStatus() === FormEntity::STATUS_DISABLED ? ' (' . __('inactive', 'mailpoet') . ')' : ''; ?> diff --git a/mailpoet/lib/Models/Newsletter.php b/mailpoet/lib/Models/Newsletter.php index 365bd38eed..ccccd8ef6c 100644 --- a/mailpoet/lib/Models/Newsletter.php +++ b/mailpoet/lib/Models/Newsletter.php @@ -158,7 +158,7 @@ class Newsletter extends Model { if (!$this->body || empty(json_decode($this->getBodyString()))) { $this->setError( Helpers::replaceLinkTags( - __('This is an empty email without any content and it cannot be sent. Please update [link]the email[/link].'), + __('This is an empty email without any content and it cannot be sent. Please update [link]the email[/link].', 'mailpoet'), 'admin.php?page=mailpoet-newsletter-editor&id=' . $this->id ) ); diff --git a/mailpoet/lib/Newsletter/Scheduler/AutomationEmailScheduler.php b/mailpoet/lib/Newsletter/Scheduler/AutomationEmailScheduler.php index 1a6513e930..2f57b95445 100644 --- a/mailpoet/lib/Newsletter/Scheduler/AutomationEmailScheduler.php +++ b/mailpoet/lib/Newsletter/Scheduler/AutomationEmailScheduler.php @@ -32,7 +32,7 @@ class AutomationEmailScheduler { if ($email->getType() !== NewsletterEntity::TYPE_AUTOMATION) { throw InvalidStateException::create()->withMessage( // translators: %s is the type which was given. - sprintf(__("Email with type 'automation' expected, '%s' given."), $email->getType()) + sprintf(__("Email with type 'automation' expected, '%s' given.", 'mailpoet'), $email->getType()) ); } diff --git a/mailpoet/lib/Services/Bridge/API.php b/mailpoet/lib/Services/Bridge/API.php index ec706c0c73..3fe39c2fba 100644 --- a/mailpoet/lib/Services/Bridge/API.php +++ b/mailpoet/lib/Services/Bridge/API.php @@ -207,7 +207,7 @@ class API { $errorResponseData = json_decode($errorBody, true); // translators: %d is the error code. - $fallbackError = sprintf(__('An error has happened while performing a request, the server has responded with response code %d'), $code); + $fallbackError = sprintf(__('An error has happened while performing a request, the server has responded with response code %d', 'mailpoet'), $code); $errorData = is_array($errorResponseData) && isset($errorResponseData['error']) ? $errorResponseData['error'] : $fallbackError; return ['error' => $errorData, 'status' => false];