Fix WordPress.WP.I18n.MissingArgDomain

[MAILPOET-4524]
This commit is contained in:
David Remer
2022-08-04 13:54:44 +03:00
committed by Veljko V
parent 76048224d1
commit 97e160bf67
8 changed files with 10 additions and 9 deletions

View File

@@ -106,8 +106,9 @@ class Settings {
if (isset($_GET['enable-customizer-notice'])) { if (isset($_GET['enable-customizer-notice'])) {
$notice = new WPNotice(WPNotice::TYPE_ERROR, _x( $notice = new WPNotice(WPNotice::TYPE_ERROR, _x(
'You need to have WooCommerce active to access the MailPoet email customizer for WooCommerce.', 'You need to have WooCommerce active to access the MailPoet email customizer for WooCommerce.',
'Notice in Settings when WooCommerce is not enabled' 'Notice in Settings when WooCommerce is not enabled',
), 'mailpoet'); 'mailpoet'
));
$notice->displayWPNotice(); $notice->displayWPNotice();
} }
$this->pageRenderer->displayPage('settings.html', $data); $this->pageRenderer->displayPage('settings.html', $data);

View File

@@ -27,7 +27,7 @@ class SegmentSubscribedTrigger implements Trigger {
} }
public function getName(): string { public function getName(): string {
return __('Subscribed to segment'); return __('Subscribed to segment', 'mailpoet');
} }
public function getArgsSchema(): ObjectSchema { public function getArgsSchema(): ObjectSchema {

View File

@@ -103,7 +103,7 @@ class Renderer {
} catch (\RuntimeException $e) { } catch (\RuntimeException $e) {
throw new \Exception(sprintf( throw new \Exception(sprintf(
// translators: %1$s is the name of the render, %2$s the folder path, %3$s the error message. // 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, $template,
$this->cachePath, $this->cachePath,
$e->getMessage() $e->getMessage()

View File

@@ -75,7 +75,7 @@ class Migration extends SimpleWorker {
$mailerLog = MailerLog::setError( $mailerLog = MailerLog::setError(
$mailerLog, $mailerLog,
'migration', '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); return MailerLog::pauseSending($mailerLog);
} }

View File

@@ -150,7 +150,7 @@ class Widget extends \WP_Widget {
// Select the first one from the list if none selected // Select the first one from the list if none selected
if ($selectedForm === 0 && !empty($forms)) $selectedForm = $forms[0]->getId(); if ($selectedForm === 0 && !empty($forms)) $selectedForm = $forms[0]->getId();
foreach ($forms as $form) { 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') . ')' : ''; $formName .= $form->getStatus() === FormEntity::STATUS_DISABLED ? ' (' . __('inactive', 'mailpoet') . ')' : '';
?> ?>
<option value="<?php echo esc_attr((string)$form->getId()); ?>" <?php echo ($selectedForm === $form->getId()) ? 'selected="selected"' : ''; ?>><?php echo esc_html($formName); ?></option> <option value="<?php echo esc_attr((string)$form->getId()); ?>" <?php echo ($selectedForm === $form->getId()) ? 'selected="selected"' : ''; ?>><?php echo esc_html($formName); ?></option>

View File

@@ -158,7 +158,7 @@ class Newsletter extends Model {
if (!$this->body || empty(json_decode($this->getBodyString()))) { if (!$this->body || empty(json_decode($this->getBodyString()))) {
$this->setError( $this->setError(
Helpers::replaceLinkTags( 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 'admin.php?page=mailpoet-newsletter-editor&id=' . $this->id
) )
); );

View File

@@ -32,7 +32,7 @@ class AutomationEmailScheduler {
if ($email->getType() !== NewsletterEntity::TYPE_AUTOMATION) { if ($email->getType() !== NewsletterEntity::TYPE_AUTOMATION) {
throw InvalidStateException::create()->withMessage( throw InvalidStateException::create()->withMessage(
// translators: %s is the type which was given. // 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())
); );
} }

View File

@@ -207,7 +207,7 @@ class API {
$errorResponseData = json_decode($errorBody, true); $errorResponseData = json_decode($errorBody, true);
// translators: %d is the error code. // 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; $errorData = is_array($errorResponseData) && isset($errorResponseData['error']) ? $errorResponseData['error'] : $fallbackError;
return ['error' => $errorData, 'status' => false]; return ['error' => $errorData, 'status' => false];