Add missing translation domains

[MAILPOET-2494]
This commit is contained in:
Pavel Dohnal
2019-10-29 13:10:05 +01:00
committed by Jack Kitterhing
parent a54d9f35ec
commit 1095cba1f1
3 changed files with 11 additions and 11 deletions

View File

@@ -107,7 +107,7 @@ class Settings {
$notice = new WPNotice(WPNotice::TYPE_ERROR, $this->wp->_x( $notice = new WPNotice(WPNotice::TYPE_ERROR, $this->wp->_x(
'You need to enable MailPoet email customizer for WooCommerce if you want to access to the customizer.', 'You need to enable MailPoet email customizer for WooCommerce if you want to access to the customizer.',
'Notice in Settings when WooCommerce customizer is not enabled' 'Notice in Settings when WooCommerce customizer is not enabled'
)); ), 'mailpoet');
$notice->displayWPNotice(); $notice->displayWPNotice();
} }
$this->page_renderer->displayPage('settings.html', $data); $this->page_renderer->displayPage('settings.html', $data);

View File

@@ -46,14 +46,14 @@ class UnauthorizedEmailInNewslettersNotice {
} }
private function getMessageText() { private function getMessageText() {
$message = $this->wp->__('<b>Your automatic emails have been paused,</b> because some email addresses havent been authorized yet.'); $message = $this->wp->__('<b>Your automatic emails have been paused,</b> because some email addresses havent been authorized yet.', 'mailpoet');
return "<p>$message</p>"; return "<p>$message</p>";
} }
private function getNewslettersLinks($validation_error) { private function getNewslettersLinks($validation_error) {
$links = ''; $links = '';
foreach ($validation_error['invalid_senders_in_newsletters'] as $error) { foreach ($validation_error['invalid_senders_in_newsletters'] as $error) {
$link_text = $this->wp->_x('Update the from address of %s', '%s will be replaced by a newsletter subject'); $link_text = $this->wp->_x('Update the from address of %s', '%s will be replaced by a newsletter subject', 'mailpoet');
$link_text = str_replace('%s', EscapeHelper::escapeHtmlText($error['subject']), $link_text); $link_text = str_replace('%s', EscapeHelper::escapeHtmlText($error['subject']), $link_text);
$link_url = $this->wp->adminUrl('admin.php?page=' . Menu::MAIN_PAGE_SLUG . '#/send/' . $error['newsletter_id']); $link_url = $this->wp->adminUrl('admin.php?page=' . Menu::MAIN_PAGE_SLUG . '#/send/' . $error['newsletter_id']);
$link = Helpers::replaceLinkTags("[link]{$link_text}[/link]", $link_url, ['target' => '_blank']); $link = Helpers::replaceLinkTags("[link]{$link_text}[/link]", $link_url, ['target' => '_blank']);
@@ -65,16 +65,16 @@ class UnauthorizedEmailInNewslettersNotice {
private function getAuthorizationLink($validation_error) { private function getAuthorizationLink($validation_error) {
$emails = array_unique(array_column($validation_error['invalid_senders_in_newsletters'], 'sender_address')); $emails = array_unique(array_column($validation_error['invalid_senders_in_newsletters'], 'sender_address'));
if (count($emails) > 1) { if (count($emails) > 1) {
$authorize_link = $this->wp->_x('Authorize %1$s and %2$s', 'Link for user to authorize their email address'); $authorize_link = $this->wp->_x('Authorize %1$s and %2$s', 'Link for user to authorize their email address', 'mailpoet');
$authorize_link = str_replace('%2$s', EscapeHelper::escapeHtmlText(array_pop($emails)), $authorize_link); $authorize_link = str_replace('%2$s', EscapeHelper::escapeHtmlText(array_pop($emails)), $authorize_link);
$authorize_link = str_replace('%1$s', EscapeHelper::escapeHtmlText(implode(', ', $emails)), $authorize_link); $authorize_link = str_replace('%1$s', EscapeHelper::escapeHtmlText(implode(', ', $emails)), $authorize_link);
} else { } else {
$authorize_link = $this->wp->_x('Authorize %s', 'Link for user to authorize their email address'); $authorize_link = $this->wp->_x('Authorize %s', 'Link for user to authorize their email address', 'mailpoet');
$authorize_link = str_replace('%s', EscapeHelper::escapeHtmlText($emails[0]), $authorize_link); $authorize_link = str_replace('%s', EscapeHelper::escapeHtmlText($emails[0]), $authorize_link);
} }
$authorize_link = Helpers::replaceLinkTags("[link]{$authorize_link}[/link]", 'https://account.mailpoet.com/authorization', ['target' => '_blank']); $authorize_link = Helpers::replaceLinkTags("[link]{$authorize_link}[/link]", 'https://account.mailpoet.com/authorization', ['target' => '_blank']);
$html = '<p><b>' . $this->wp->_x('OR', 'User has to choose between two options') . '</b></p>'; $html = '<p><b>' . $this->wp->_x('OR', 'User has to choose between two options', 'mailpoet') . '</b></p>';
$html .= "<p>$authorize_link</p>"; $html .= "<p>$authorize_link</p>";
return $html; return $html;
} }

View File

@@ -42,8 +42,8 @@ class UnauthorizedEmailNotice {
private function getMessageText($validation_error) { private function getMessageText($validation_error) {
$text = $this->wp->_x('<b>Sending all of your emails has been paused</b> because your email address %s hasnt been authorized yet.</b>', $text = $this->wp->_x('<b>Sending all of your emails has been paused</b> because your email address %s hasnt been authorized yet.</b>',
'Email addresses have to be authorized to be used to send emails. %s will be replaced by an email address.' 'Email addresses have to be authorized to be used to send emails. %s will be replaced by an email address.',
); 'mailpoet');
$message = str_replace('%s', EscapeHelper::escapeHtmlText($validation_error['invalid_sender_address']), $text); $message = str_replace('%s', EscapeHelper::escapeHtmlText($validation_error['invalid_sender_address']), $text);
return "<p>$message</p>"; return "<p>$message</p>";
} }
@@ -51,7 +51,7 @@ class UnauthorizedEmailNotice {
private function getSettingsButtons($validation_error) { private function getSettingsButtons($validation_error) {
$buttons = ''; $buttons = '';
if (!empty($validation_error['invalid_sender_address'])) { if (!empty($validation_error['invalid_sender_address'])) {
$button = $this->wp->_x('Update my Default sender email address', 'Please reuse the current translation of “Default sender”'); $button = $this->wp->_x('Update my Default sender email address', 'Please reuse the current translation of “Default sender”', 'mailpoet');
$button = Helpers::replaceLinkTags("[link]{$button}[/link]", 'admin.php?page=mailpoet-settings', ['class' => 'button button-secondary']); $button = Helpers::replaceLinkTags("[link]{$button}[/link]", 'admin.php?page=mailpoet-settings', ['class' => 'button button-secondary']);
$buttons .= "<p>$button</p>"; $buttons .= "<p>$button</p>";
} }
@@ -60,10 +60,10 @@ class UnauthorizedEmailNotice {
private function getAuthorizationLink($validation_error) { private function getAuthorizationLink($validation_error) {
$email = $validation_error['invalid_sender_address']; $email = $validation_error['invalid_sender_address'];
$authorize_link = $this->wp->_x('Authorize %s', 'Link for user to authorize their email address'); $authorize_link = $this->wp->_x('Authorize %s', 'Link for user to authorize their email address', 'mailpoet');
$authorize_link = str_replace('%s', EscapeHelper::escapeHtmlText($email), $authorize_link); $authorize_link = str_replace('%s', EscapeHelper::escapeHtmlText($email), $authorize_link);
$authorize_link = Helpers::replaceLinkTags("[link]{$authorize_link}[/link]", 'https://account.mailpoet.com/authorization', ['target' => '_blank']); $authorize_link = Helpers::replaceLinkTags("[link]{$authorize_link}[/link]", 'https://account.mailpoet.com/authorization', ['target' => '_blank']);
$html = '<p><b>' . $this->wp->_x('OR', 'User has to choose between two options') . '</b></p>'; $html = '<p><b>' . $this->wp->_x('OR', 'User has to choose between two options', 'mailpoet') . '</b></p>';
$html .= "<p>$authorize_link</p>"; $html .= "<p>$authorize_link</p>";
return $html; return $html;
} }