Separate the segments and lists pages on the PHP side

Until now we were using the same render() method and Twig templates for
the segments and lists pages. This commit separates them by creating two
different render() methods, one for each page, and also separing the
Twig templates. Only the translations remain shared as separating them
would be more involved and probably not worth it.

[MAILPOET-5392]
This commit is contained in:
Rodrigo Primo
2023-07-11 10:42:25 -03:00
committed by Aschepikov
parent f156629a93
commit c72fce9aae
8 changed files with 349 additions and 299 deletions

View File

@@ -20,7 +20,7 @@ use MailPoet\WP\AutocompletePostListLoader as WPPostListLoader;
use MailPoet\WP\Functions as WPFunctions;
use MailPoetVendor\Doctrine\Common\Collections\Criteria;
class Segments {
class DynamicSegments {
/** @var PageRenderer */
private $pageRenderer;
@@ -86,12 +86,10 @@ class Segments {
}
/**
* @param string $type 'static' or 'dynamic'
* @return void
*/
public function render(string $type) {
public function render() {
$data = [];
$data['segments_type'] = $type;
$data['items_per_page'] = $this->listingPageLimit->getLimitPerPage('segments');
$customFields = $this->customFieldsRepository->findBy([], ['name' => 'asc']);
@@ -171,7 +169,8 @@ class Segments {
'name' => $automation->getName(),
];
}, $this->automationStorage->getAutomations());
$this->pageRenderer->displayPage('segments.html', $data);
$this->pageRenderer->displayPage('segments/dynamic.html', $data);
}
private function getNewslettersList(): array {

View File

@@ -0,0 +1,32 @@
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
namespace MailPoet\AdminPages\Pages;
use MailPoet\AdminPages\PageRenderer;
use MailPoet\Listing\PageLimit;
class StaticSegments {
/** @var PageRenderer */
private $pageRenderer;
/** @var PageLimit */
private $listingPageLimit;
public function __construct(
PageRenderer $pageRenderer,
PageLimit $listingPageLimit
) {
$this->pageRenderer = $pageRenderer;
$this->listingPageLimit = $listingPageLimit;
}
/**
* @return void
*/
public function render() {
$data = [];
$data['items_per_page'] = $this->listingPageLimit->getLimitPerPage('segments');
$this->pageRenderer->displayPage('segments/static.html', $data);
}
}

View File

@@ -6,6 +6,7 @@ use MailPoet\AdminPages\Pages\Automation;
use MailPoet\AdminPages\Pages\AutomationAnalytics;
use MailPoet\AdminPages\Pages\AutomationEditor;
use MailPoet\AdminPages\Pages\AutomationTemplates;
use MailPoet\AdminPages\Pages\DynamicSegments;
use MailPoet\AdminPages\Pages\ExperimentalFeatures;
use MailPoet\AdminPages\Pages\FormEditor;
use MailPoet\AdminPages\Pages\Forms;
@@ -15,8 +16,8 @@ use MailPoet\AdminPages\Pages\Landingpage;
use MailPoet\AdminPages\Pages\Logs;
use MailPoet\AdminPages\Pages\NewsletterEditor;
use MailPoet\AdminPages\Pages\Newsletters;
use MailPoet\AdminPages\Pages\Segments;
use MailPoet\AdminPages\Pages\Settings;
use MailPoet\AdminPages\Pages\StaticSegments;
use MailPoet\AdminPages\Pages\Subscribers;
use MailPoet\AdminPages\Pages\SubscribersExport;
use MailPoet\AdminPages\Pages\SubscribersImport;
@@ -631,11 +632,11 @@ class Menu {
}
public function lists() {
$this->container->get(Segments::class)->render('static');
$this->container->get(StaticSegments::class)->render();
}
public function segments() {
$this->container->get(Segments::class)->render('dynamic');
$this->container->get(DynamicSegments::class)->render();
}
public function forms() {

View File

@@ -35,6 +35,7 @@ class ContainerConfigurator implements IContainerConfigurator {
$container->autowire(\MailPoet\AdminPages\Pages\AutomationTemplates::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\AutomationEditor::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\AutomationAnalytics::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\DynamicSegments::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\ExperimentalFeatures::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\FormEditor::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\Forms::class)->setPublic(true);
@@ -44,8 +45,8 @@ class ContainerConfigurator implements IContainerConfigurator {
$container->autowire(\MailPoet\AdminPages\Pages\NewsletterEditor::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\Newsletters::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\Upgrade::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\Segments::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\Settings::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\StaticSegments::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\Subscribers::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\SubscribersExport::class)->setPublic(true);
$container->autowire(\MailPoet\AdminPages\Pages\SubscribersImport::class)->setPublic(true);

View File

@@ -1,290 +0,0 @@
<% extends 'layout.html' %>
<% block content %>
<% if segments_type == 'static' %>
<div id="static_segments_container"></div>
<% else %>
<div id="dynamic_segments_container"></div>
<% endif %>
<script type="text/javascript">
var mailpoet_listing_per_page = <%= items_per_page %>;
var mailpoet_beacon_articles = [
'5d667fc22c7d3a7a4d77c426',
'57f47ca3c697914f21035256',
'5d4beee42c7d3a330e3c4207',
'5e187a3a2c7d3a7e9ae607ff',
'57ce079f903360649f6e56fc',
'5d722c7104286364bc8ecf19',
'5a574bd92c7d3a194368233e',
'59a89621042863033a1c82e6'
];
var mailpoet_custom_fields = <%= json_encode(custom_fields) %>;
var mailpoet_static_segments_list = <%= json_encode(static_segments_list) %>;
var wordpress_editable_roles_list = <%= json_encode(wordpress_editable_roles_list) %>;
var mailpoet_newsletters_list = <%= json_encode(newsletters_list) %>;
var mailpoet_product_categories = <%= json_encode(product_categories) %>;
var mailpoet_products = <%= json_encode(products) %>;
var mailpoet_membership_plans = <%= json_encode(membership_plans) %>;
var mailpoet_subscription_products = <%= json_encode(subscription_products) %>;
var mailpoet_can_use_woocommerce_memberships = <%= json_encode(can_use_woocommerce_memberships) %>;
var mailpoet_can_use_woocommerce_subscriptions = <%= json_encode(can_use_woocommerce_subscriptions) %>;
var mailpoet_woocommerce_currency_symbol = <%= json_encode(woocommerce_currency_symbol) %>;
var mailpoet_woocommerce_countries = <%= json_encode(woocommerce_countries) %>;
var mailpoet_woocommerce_payment_methods = <%= json_encode(woocommerce_payment_methods) %>;
var mailpoet_woocommerce_shipping_methods = <%= json_encode(woocommerce_shipping_methods) %>;
var mailpoet_signup_forms = <%= json_encode(signup_forms) %>;
var mailpoet_automations = <%= json_encode(automations) %>;
</script>
<% endblock %>
<% block translations %>
<%= localize({
'pageTitle': __('Lists'),
'searchLabel': __('Search'),
'loadingItems': __('Loading lists...'),
'noItemsFound': __('No lists found'),
'permanentlyDeleted': __('%d lists were permanently deleted.'),
'selectBulkAction': __('Select bulk action'),
'bulkActions': __('Bulk Actions'),
'apply': __('Apply'),
'name': __('Name'),
'description': __('Description'),
'segmentUpdated': __('List successfully updated!'),
'segmentAdded': __('List successfully added!'),
'segment': __('List'),
'subscribed': __('Subscribed'),
'unconfirmed': __('Unconfirmed'),
'unsubscribed': __('Unsubscribed'),
'inactive': __('Inactive'),
'bounced': __('Bounced'),
'createdOn': __('Created on'),
'oneSegmentTrashed': __('1 list was moved to the trash. Note that deleting a list does not delete its subscribers.'),
'multipleSegmentsTrashed': __('%1$d lists were moved to the trash. Note that deleting a list does not delete its subscribers.'),
'oneSegmentDeleted': __('1 list was permanently deleted. Note that deleting a list does not delete its subscribers.'),
'multipleSegmentsDeleted': __('%1$d lists were permanently deleted. Note that deleting a list does not delete its subscribers.'),
'oneSegmentRestored': __('1 list has been restored from the Trash.'),
'multipleSegmentsRestored': __('%1$d lists have been restored from the Trash.'),
'duplicate': __('Duplicate'),
'listDuplicated': __('List "%1$s" has been duplicated.'),
'segmentDuplicated': __('Segment "%1$s" has been duplicated.'),
'update': __('Update'),
'forceSync': __('Force Sync'),
'readMore': __('Read More'),
'listSynchronized': __('List "%1$s" has been synchronized.'),
'listSynchronizationWasScheduled': __('Synchronization of the "%1$s" list started. It can take several minutes to finish.'),
'viewSubscribers': __('View Subscribers'),
'new': __('New List'),
'newSegment': __('New Segment'),
'edit': __('Edit'),
'trash': __('Trash'),
'moveToTrash': __('Move to trash'),
'emptyTrash': __('Empty Trash'),
'selectAll': __('Select All'),
'restore': __('Restore'),
'deletePermanently': __('Delete permanently'),
'save': __('Save'),
'trashAndDisable': __('Trash and disable'),
'restoreAndEnable': __('Restore and enable'),
'listScore': __('List score'),
'previousPage': __('Previous page'),
'firstPage': __('First page'),
'nextPage': __('Next page'),
'lastPage': __('Last page'),
'currentPage': __('Current page'),
'pageOutOf': __('of'),
'numberOfItemsSingular': __('1 item'),
'numberOfItemsMultiple': __('%1$d items'),
'segmentDescriptionTip': __('This text box is for your own use and is never shown to your subscribers.'),
'backToList': __('Back'),
'showInManageSubscriptionPage': __('List visibility'),
'showInManageSubscriptionPageTip': __('Show this list on the "Manage Subscription" page'),
'subscribersInPlanCount': _x('%1$d / %2$d', 'count / total subscribers'),
'subscribersInPlan': _x('%s subscribers in your plan', 'number of subscribers in a sending plan'),
'subscribersInPlanTooltip': __('This is the total of subscribed, unconfirmed and inactive subscribers we count when you are sending with MailPoet Sending Service. The count excludes unsubscribed and bounced (invalid) email addresses.'),
'mailpoetSubscribers': _x('%s MailPoet subscribers', 'number of subscribers in the plugin'),
'mailpoetSubscribersTooltipFree': __('This is the total of all subscribers including %1$d WordPress users. To exclude WordPress users, please purchase one of our premium plans.'),
'mailpoetSubscribersTooltipPremium': __('This is the total of all subscribers excluding all WordPress users.'),
'pageTitleSegments': __('Segments'),
'formPageTitle': __('Segment'),
'formSegmentTitle': __('Segment'),
'descriptionTip': __('This text box is for your own use and is never shown to your subscribers.'),
'dynamicSegmentUpdated': __('Segment successfully updated!'),
'dynamicSegmentAdded': __('Segment successfully added!'),
'segmentType': __('Type'),
'wpUserRole': __('Subscriber'),
'email': __('Email'),
'nameColumn': __('Name'),
'subscribersCountColumn': __('Number of subscribers'),
'updatedAtColumn': __('Modified on'),
'missingPluginMessageColumn': __('Missing plugin message'),
'loadingDynamicSegmentItems': __('Loading data…'),
'noDynamicSegmentItemsFound': __('No segments found'),
'numberOfItemsSingular': __('1 item'),
'numberOfItemsMultiple': __('%1$d items'),
'previousPage': __('Previous page'),
'firstPage': __('First page'),
'nextPage': __('Next page'),
'lastPage': __('Last page'),
'currentPage': __('Current page'),
'pageOutOf': _x('of', 'Page X of Y'),
'notSentYet': __('Not sent yet'),
'allLinksPlaceholder': __('All links'),
'noLinksHint': __('Email not sent yet!'),
'selectNewsletterPlaceholder': __('Search emails'),
'selectActionPlaceholder': __('Select action'),
'selectUserRolePlaceholder': __('Search user roles'),
'selectCustomFieldPlaceholder': __('Select custom field'),
'emailActionOpened': _x('opened', 'Dynamic segment creation: when newsletter was opened'),
'emailActionWasSent': _x('was sent', 'Dynamic segment creation: when newsletter was sent'),
'emailActionMachineOpened': _x('machine-opened', 'Dynamic segment creation: list of all subscribers that opened the newsletter automatically in the background'),
'emailActionOpensAbsoluteCount': __('number of opens'),
'emailActionMachineOpensAbsoluteCount': __('number of machine-opens'),
'emailActionOpens': __('opens'),
'emailActionDays': __('days'),
'emailActionOpensSentence': _x('{condition} {opens} opens', 'The result will be "more than 20 opens"'),
'emailActionOpensDaysSentence': _x('in the last {days} days', 'The result will be "in the last 5 days"'),
'moreThan': __('more than'),
'lessThan': __('less than'),
'higherThan': __('higher than'),
'lowerThan': __('lower than'),
'equals': __('equals'),
'notEquals': __('not equals'),
'contains': __('contains'),
'notContains': __('does not contain'),
'value': __('value'),
'selectValue': __('Select value'),
'checked': __('checked'),
'unchecked': __('unchecked'),
'unknown': __('unknown'),
'notUnknown': __('not unknown'),
'is': __('is'),
'isNot': __('is not'),
'startsWith': __('starts with'),
'notStartsWith': __('does not start with'),
'endsWith': __('ends with'),
'notEndsWith': __('does not end with'),
'firstName': __('First name'),
'lastName': __('Last name'),
'email': __('Email'),
'before': _x('before', 'Meaning: "Subscriber subscribed before April"'),
'after': _x('after', 'Meaning: "Subscriber subscribed after April'),
'on': _x('on', 'Meaning: "Subscriber subscribed on a given date"'),
'notOn': _x('not on', 'Meaning: "Subscriber subscribed on a date other than the given date"'),
'inTheLast': _x('in the last', 'Meaning: "Subscriber subscribed in the last 3 days"'),
'notInTheLast': _x('not in the last', 'Meaning: "Subscriber subscribed not in the last 3 days"'),
'emailActionNotOpened': _x('not opened', 'Dynamic segment creation: when newsletter was not opened'),
'emailActionClicked': _x('clicked', 'Dynamic segment creation: when a newsletter link was clicked'),
'emailActionClickedAnyEmail': _x('clicked any email', 'Dynamic segment creation: when a newsletter link in any email was clicked'),
'emailActionNotClicked': _x('not clicked', 'Dynamic segment creation: when a newsletter link was not clicked'),
'searchLabel': __('Search'),
'segmentsTip': _x('Tip', 'A note about dynamic segments usage'),
'segmentsTipText': __('segments allow you to group your subscribers by other criteria, such as events and actions.'),
'segmentsTipLink': __('Read more.'),
'subscribedDate': __('subscribed date'),
'subscriberScore': _x('engagement score', 'Subscriber engagement score'),
'subscriberScorePlaceholder': _x('score', 'Placeholder for input: subscriber engagement score'),
'subscriberScoreSentence': _x('{condition} {score} %', 'The result will be "higher than 20 %"'),
'subscribedToList': __('subscribed to list'),
'subscribedViaForm': __('subscribed via form'),
'segmentsSubscriber': __('WordPress user role'),
'mailpoetCustomField': __('MailPoet custom field'),
'segmentsActiveMembership': __('is member of'),
'woocommerceMemberships': _x('WooCommerce Memberships', 'Dynamic segment creation: User selects this to use any WooCommerce Memberships filters'),
'selectWooMembership': __('Search membership plans'),
'segmentsActiveSubscription': __('has active subscription'),
'woocommerceSubscriptions': _x('WooCommerce Subscriptions', 'Dynamic segment creation: User selects this to use any WooCommerce Subscriptions filters'),
'wooUsedPaymentMethod': __('used payment method'),
'wooUsedShippingMethod': __('used shipping method'),
'selectWooSubscription': __('Search subscriptions'),
'searchLists': __('Search lists'),
'subscriberTag': _x('tag', 'Subscriber tag'),
'searchTags': _x('Search tags'),
'searchForms': __('Search forms'),
'anyOf': __('any of'),
'allOf': __('all of'),
'noneOf': __('none of'),
'oneDynamicSegmentTrashed': __('1 segment was moved to the trash.'),
'multipleDynamicSegmentsTrashed': __('%1$d segments were moved to the trash.'),
'oneDynamicSegmentRestored': __('1 segment has been restored from the Trash.'),
'multipleDynamicSegmentsRestored': __('%1$d segments have been restored from the Trash.'),
'multipleDynamicSegmentsDeleted': __('%1$d segments were permanently deleted.'),
'oneDynamicSegmentDeleted': __('1 segment was permanently deleted.'),
'automations': __('Automations'),
'automationsEnteredAutomation': __('entered automation'),
'automationsExitedAutomation': __('exited automation'),
'searchAutomations': __('Search automations'),
'wooNumberOfOrders': __('number of orders'),
'moreThan': __('more than'),
'moreThanOrEqual': __('more than or equal'),
'lessThan': __('less than'),
'lessThanOrEqual': __('less than or equal'),
'wooNumberOfOrdersCount': __('count'),
'daysPlaceholder': __('days'),
'days': _x('days', 'Appears together with `inTheLast` when creating a new WooCommerce segment based on the number of orders.'),
'inTheLast': _x('in the last', 'Appears together with `days` when creating a new WooCommerce segment based on the number of orders.'),
'wooAverageSpent': __('average order value'),
'wooNumberOfOrdersOrders': __('orders'),
'wooPurchasedCategory': __('purchased in category'),
'wooPurchaseDate': __('purchase date'),
'wooPurchasedProduct': __('purchased product'),
'wooTotalSpent': __('total spent'),
'wooCustomerInCountry': __('country'),
'wooCustomerInCity': __('city'),
'wooCustomerInPostalCode': __('postal code'),
'wooSingleOrderValue': __('single order value'),
'wooSpentAmount': __('amount'),
'selectWooPurchasedCategory': __('Search categories'),
'selectWooPurchasedProduct': __('Search products'),
'selectWooCountry': __('Search countries'),
'selectWooPaymentMethods': __('Search payment methods'),
'selectWooShippingMethods': __('Search shipping methods'),
'woocommerce': _x('WooCommerce', 'Dynamic segment creation: User selects this to use any woocommerce filters'),
'dynamicSegmentSizeIsCalculated': __('Calculating segment size…'),
'dynamicSegmentSizeCalculatingTimeout': __("It's taking longer than usual to generate the segment, which may be due to a complex configuration. Try using fewer or simpler conditions."),
'dynamicSegmentSize': __('This segment has %1$d subscribers.'),
'learnMore': __('Learn more.'),
'unknownBadgeName': __('Unknown'),
'unknownBadgeTooltip': __('Not enough data.'),
'tooltipUnknown': __('Fewer than 3 emails sent'),
'excellentBadgeName': __('Excellent'),
'excellentBadgeTooltip': __('Congrats!'),
'tooltipExcellent': __('50% or more'),
'goodBadgeName': __('Good'),
'goodBadgeTooltip': __('Good stuff.'),
'tooltipGood': __('between 20 and 50%'),
'averageBadgeName': __('Low'),
'averageBadgeTooltip': __('Something to improve.'),
'tooltipAverage': __('20% or fewer'),
'engagementScoreDescription': __('Average percent of emails subscribers read in the last year'),
'addCondition': __('Add a condition'),
'privacyProtectionNotice': __('Due to email privacy protections, some opens may not be tracked. Consider using a different engagement metric.'),
'premiumFeatureMultipleConditions': __('Your current MailPoet plan does not support advanced segments with multiple conditions. Upgrade to the MailPoet Business plan to more precisely target your emails based on how people engage with your business. [link]Learn more.[/link]'),
'premiumBannerCtaFree': __('Upgrade'),
'premiumFeatureDescription': __('Your current MailPoet plan includes advanced features, but they require the MailPoet Premium plugin to be installed and activated.'),
'premiumFeatureButtonDownloadPremium': __('Download MailPoet Premium plugin'),
'premiumFeatureButtonActivatePremium': __('Activate MailPoet Premium plugin'),
'premiumFeatureDescriptionSubscribersLimitReached': __('Congratulations, you now have [subscribersCount] subscribers! Your plan is limited to [subscribersLimit] subscribers. You need to upgrade now to be able to continue using MailPoet.'),
'premiumFeatureButtonUpgradePlan': __('Upgrade your plan'),
}) %>
<% endblock %>
<% block after_translations %>
<%= do_action('mailpoet_segments_translations_after') %>
<% endblock %>

View File

@@ -0,0 +1,42 @@
<% extends 'layout.html' %>
<% block content %>
<div id="dynamic_segments_container"></div>
<script type="text/javascript">
var mailpoet_listing_per_page = <%= items_per_page %>;
var mailpoet_beacon_articles = [
'5d667fc22c7d3a7a4d77c426', // https://kb.mailpoet.com/article/282-create-a-list
'57f47ca3c697914f21035256', // https://kb.mailpoet.com/article/133-the-wordpress-users-list
'5d4beee42c7d3a330e3c4207', // https://kb.mailpoet.com/article/278-the-woocommerce-customers-list
'5e187a3a2c7d3a7e9ae607ff', // https://kb.mailpoet.com/article/294-managing-your-subscribers-list
'57ce079f903360649f6e56fc', // https://kb.mailpoet.com/article/126-importing-subscribers-with-csv-files
'5d722c7104286364bc8ecf19', // https://kb.mailpoet.com/article/284-import-old-customers-to-the-woocommerce-customers-list
'59a89621042863033a1c82e6' // https://kb.mailpoet.com/article/205-roles-and-permissions
];
var mailpoet_custom_fields = <%= json_encode(custom_fields) %>;
var mailpoet_static_segments_list = <%= json_encode(static_segments_list) %>;
var wordpress_editable_roles_list = <%= json_encode(wordpress_editable_roles_list) %>;
var mailpoet_newsletters_list = <%= json_encode(newsletters_list) %>;
var mailpoet_product_categories = <%= json_encode(product_categories) %>;
var mailpoet_products = <%= json_encode(products) %>;
var mailpoet_membership_plans = <%= json_encode(membership_plans) %>;
var mailpoet_subscription_products = <%= json_encode(subscription_products) %>;
var mailpoet_can_use_woocommerce_memberships = <%= json_encode(can_use_woocommerce_memberships) %>;
var mailpoet_can_use_woocommerce_subscriptions = <%= json_encode(can_use_woocommerce_subscriptions) %>;
var mailpoet_woocommerce_currency_symbol = <%= json_encode(woocommerce_currency_symbol) %>;
var mailpoet_woocommerce_countries = <%= json_encode(woocommerce_countries) %>;
var mailpoet_woocommerce_payment_methods = <%= json_encode(woocommerce_payment_methods) %>;
var mailpoet_woocommerce_shipping_methods = <%= json_encode(woocommerce_shipping_methods) %>;
var mailpoet_signup_forms = <%= json_encode(signup_forms) %>;
var mailpoet_automations = <%= json_encode(automations) %>;
</script>
<% endblock %>
<% block translations %>
<% include 'segments/translations.html' %>
<% endblock %>
<% block after_translations %>
<%= do_action('mailpoet_segments_translations_after') %>
<% endblock %>

View File

@@ -0,0 +1,21 @@
<% extends 'layout.html' %>
<% block content %>
<div id="static_segments_container"></div>
<script type="text/javascript">
var mailpoet_listing_per_page = <%= items_per_page %>;
var mailpoet_beacon_articles = [
'5a574bd92c7d3a194368233e', // https://kb.mailpoet.com/article/237-guide-to-subscriber-segmentation
'59a89621042863033a1c82e6' // https://kb.mailpoet.com/article/205-roles-and-permissions
];
</script>
<% endblock %>
<% block translations %>
<% include 'segments/translations.html' %>
<% endblock %>
<% block after_translations %>
<%= do_action('mailpoet_segments_translations_after') %>
<% endblock %>

View File

@@ -0,0 +1,244 @@
<%= localize({
'pageTitle': __('Lists'),
'searchLabel': __('Search'),
'loadingItems': __('Loading lists...'),
'noItemsFound': __('No lists found'),
'permanentlyDeleted': __('%d lists were permanently deleted.'),
'selectBulkAction': __('Select bulk action'),
'bulkActions': __('Bulk Actions'),
'apply': __('Apply'),
'name': __('Name'),
'description': __('Description'),
'segmentUpdated': __('List successfully updated!'),
'segmentAdded': __('List successfully added!'),
'segment': __('List'),
'subscribed': __('Subscribed'),
'unconfirmed': __('Unconfirmed'),
'unsubscribed': __('Unsubscribed'),
'inactive': __('Inactive'),
'bounced': __('Bounced'),
'createdOn': __('Created on'),
'oneSegmentTrashed': __('1 list was moved to the trash. Note that deleting a list does not delete its subscribers.'),
'multipleSegmentsTrashed': __('%1$d lists were moved to the trash. Note that deleting a list does not delete its subscribers.'),
'oneSegmentDeleted': __('1 list was permanently deleted. Note that deleting a list does not delete its subscribers.'),
'multipleSegmentsDeleted': __('%1$d lists were permanently deleted. Note that deleting a list does not delete its subscribers.'),
'oneSegmentRestored': __('1 list has been restored from the Trash.'),
'multipleSegmentsRestored': __('%1$d lists have been restored from the Trash.'),
'duplicate': __('Duplicate'),
'listDuplicated': __('List "%1$s" has been duplicated.'),
'segmentDuplicated': __('Segment "%1$s" has been duplicated.'),
'update': __('Update'),
'forceSync': __('Force Sync'),
'readMore': __('Read More'),
'listSynchronized': __('List "%1$s" has been synchronized.'),
'listSynchronizationWasScheduled': __('Synchronization of the "%1$s" list started. It can take several minutes to finish.'),
'viewSubscribers': __('View Subscribers'),
'new': __('New List'),
'newSegment': __('New Segment'),
'edit': __('Edit'),
'trash': __('Trash'),
'moveToTrash': __('Move to trash'),
'emptyTrash': __('Empty Trash'),
'selectAll': __('Select All'),
'restore': __('Restore'),
'deletePermanently': __('Delete permanently'),
'save': __('Save'),
'trashAndDisable': __('Trash and disable'),
'restoreAndEnable': __('Restore and enable'),
'listScore': __('List score'),
'previousPage': __('Previous page'),
'firstPage': __('First page'),
'nextPage': __('Next page'),
'lastPage': __('Last page'),
'currentPage': __('Current page'),
'pageOutOf': __('of'),
'numberOfItemsSingular': __('1 item'),
'numberOfItemsMultiple': __('%1$d items'),
'segmentDescriptionTip': __('This text box is for your own use and is never shown to your subscribers.'),
'backToList': __('Back'),
'showInManageSubscriptionPage': __('List visibility'),
'showInManageSubscriptionPageTip': __('Show this list on the "Manage Subscription" page'),
'subscribersInPlanCount': _x('%1$d / %2$d', 'count / total subscribers'),
'subscribersInPlan': _x('%s subscribers in your plan', 'number of subscribers in a sending plan'),
'subscribersInPlanTooltip': __('This is the total of subscribed, unconfirmed and inactive subscribers we count when you are sending with MailPoet Sending Service. The count excludes unsubscribed and bounced (invalid) email addresses.'),
'mailpoetSubscribers': _x('%s MailPoet subscribers', 'number of subscribers in the plugin'),
'mailpoetSubscribersTooltipFree': __('This is the total of all subscribers including %1$d WordPress users. To exclude WordPress users, please purchase one of our premium plans.'),
'mailpoetSubscribersTooltipPremium': __('This is the total of all subscribers excluding all WordPress users.'),
'pageTitleSegments': __('Segments'),
'formPageTitle': __('Segment'),
'formSegmentTitle': __('Segment'),
'descriptionTip': __('This text box is for your own use and is never shown to your subscribers.'),
'dynamicSegmentUpdated': __('Segment successfully updated!'),
'dynamicSegmentAdded': __('Segment successfully added!'),
'segmentType': __('Type'),
'wpUserRole': __('Subscriber'),
'email': __('Email'),
'nameColumn': __('Name'),
'subscribersCountColumn': __('Number of subscribers'),
'updatedAtColumn': __('Modified on'),
'missingPluginMessageColumn': __('Missing plugin message'),
'loadingDynamicSegmentItems': __('Loading data…'),
'noDynamicSegmentItemsFound': __('No segments found'),
'numberOfItemsSingular': __('1 item'),
'numberOfItemsMultiple': __('%1$d items'),
'previousPage': __('Previous page'),
'firstPage': __('First page'),
'nextPage': __('Next page'),
'lastPage': __('Last page'),
'currentPage': __('Current page'),
'pageOutOf': _x('of', 'Page X of Y'),
'notSentYet': __('Not sent yet'),
'allLinksPlaceholder': __('All links'),
'noLinksHint': __('Email not sent yet!'),
'selectNewsletterPlaceholder': __('Search emails'),
'selectActionPlaceholder': __('Select action'),
'selectUserRolePlaceholder': __('Search user roles'),
'selectCustomFieldPlaceholder': __('Select custom field'),
'emailActionOpened': _x('opened', 'Dynamic segment creation: when newsletter was opened'),
'emailActionWasSent': _x('was sent', 'Dynamic segment creation: when newsletter was sent'),
'emailActionMachineOpened': _x('machine-opened', 'Dynamic segment creation: list of all subscribers that opened the newsletter automatically in the background'),
'emailActionOpensAbsoluteCount': __('number of opens'),
'emailActionMachineOpensAbsoluteCount': __('number of machine-opens'),
'emailActionOpens': __('opens'),
'emailActionDays': __('days'),
'emailActionOpensSentence': _x('{condition} {opens} opens', 'The result will be "more than 20 opens"'),
'emailActionOpensDaysSentence': _x('in the last {days} days', 'The result will be "in the last 5 days"'),
'moreThan': __('more than'),
'lessThan': __('less than'),
'higherThan': __('higher than'),
'lowerThan': __('lower than'),
'equals': __('equals'),
'notEquals': __('not equals'),
'contains': __('contains'),
'notContains': __('does not contain'),
'value': __('value'),
'selectValue': __('Select value'),
'checked': __('checked'),
'unchecked': __('unchecked'),
'unknown': __('unknown'),
'notUnknown': __('not unknown'),
'is': __('is'),
'isNot': __('is not'),
'startsWith': __('starts with'),
'notStartsWith': __('does not start with'),
'endsWith': __('ends with'),
'notEndsWith': __('does not end with'),
'firstName': __('First name'),
'lastName': __('Last name'),
'email': __('Email'),
'before': _x('before', 'Meaning: "Subscriber subscribed before April"'),
'after': _x('after', 'Meaning: "Subscriber subscribed after April'),
'on': _x('on', 'Meaning: "Subscriber subscribed on a given date"'),
'notOn': _x('not on', 'Meaning: "Subscriber subscribed on a date other than the given date"'),
'inTheLast': _x('in the last', 'Meaning: "Subscriber subscribed in the last 3 days"'),
'notInTheLast': _x('not in the last', 'Meaning: "Subscriber subscribed not in the last 3 days"'),
'emailActionNotOpened': _x('not opened', 'Dynamic segment creation: when newsletter was not opened'),
'emailActionClicked': _x('clicked', 'Dynamic segment creation: when a newsletter link was clicked'),
'emailActionClickedAnyEmail': _x('clicked any email', 'Dynamic segment creation: when a newsletter link in any email was clicked'),
'emailActionNotClicked': _x('not clicked', 'Dynamic segment creation: when a newsletter link was not clicked'),
'searchLabel': __('Search'),
'segmentsTip': _x('Tip', 'A note about dynamic segments usage'),
'segmentsTipText': __('segments allow you to group your subscribers by other criteria, such as events and actions.'),
'segmentsTipLink': __('Read more.'),
'subscribedDate': __('subscribed date'),
'subscriberScore': _x('engagement score', 'Subscriber engagement score'),
'subscriberScorePlaceholder': _x('score', 'Placeholder for input: subscriber engagement score'),
'subscriberScoreSentence': _x('{condition} {score} %', 'The result will be "higher than 20 %"'),
'subscribedToList': __('subscribed to list'),
'subscribedViaForm': __('subscribed via form'),
'segmentsSubscriber': __('WordPress user role'),
'mailpoetCustomField': __('MailPoet custom field'),
'segmentsActiveMembership': __('is member of'),
'woocommerceMemberships': _x('WooCommerce Memberships', 'Dynamic segment creation: User selects this to use any WooCommerce Memberships filters'),
'selectWooMembership': __('Search membership plans'),
'segmentsActiveSubscription': __('has active subscription'),
'woocommerceSubscriptions': _x('WooCommerce Subscriptions', 'Dynamic segment creation: User selects this to use any WooCommerce Subscriptions filters'),
'wooUsedPaymentMethod': __('used payment method'),
'wooUsedShippingMethod': __('used shipping method'),
'selectWooSubscription': __('Search subscriptions'),
'searchLists': __('Search lists'),
'subscriberTag': _x('tag', 'Subscriber tag'),
'searchTags': _x('Search tags'),
'searchForms': __('Search forms'),
'anyOf': __('any of'),
'allOf': __('all of'),
'noneOf': __('none of'),
'oneDynamicSegmentTrashed': __('1 segment was moved to the trash.'),
'multipleDynamicSegmentsTrashed': __('%1$d segments were moved to the trash.'),
'oneDynamicSegmentRestored': __('1 segment has been restored from the Trash.'),
'multipleDynamicSegmentsRestored': __('%1$d segments have been restored from the Trash.'),
'multipleDynamicSegmentsDeleted': __('%1$d segments were permanently deleted.'),
'oneDynamicSegmentDeleted': __('1 segment was permanently deleted.'),
'automations': __('Automations'),
'automationsEnteredAutomation': __('entered automation'),
'automationsExitedAutomation': __('exited automation'),
'searchAutomations': __('Search automations'),
'wooNumberOfOrders': __('number of orders'),
'moreThan': __('more than'),
'moreThanOrEqual': __('more than or equal'),
'lessThan': __('less than'),
'lessThanOrEqual': __('less than or equal'),
'wooNumberOfOrdersCount': __('count'),
'daysPlaceholder': __('days'),
'days': _x('days', 'Appears together with `inTheLast` when creating a new WooCommerce segment based on the number of orders.'),
'inTheLast': _x('in the last', 'Appears together with `days` when creating a new WooCommerce segment based on the number of orders.'),
'wooAverageSpent': __('average order value'),
'wooNumberOfOrdersOrders': __('orders'),
'wooPurchasedCategory': __('purchased in category'),
'wooPurchaseDate': __('purchase date'),
'wooPurchasedProduct': __('purchased product'),
'wooTotalSpent': __('total spent'),
'wooCustomerInCountry': __('country'),
'wooCustomerInCity': __('city'),
'wooCustomerInPostalCode': __('postal code'),
'wooSingleOrderValue': __('single order value'),
'wooSpentAmount': __('amount'),
'selectWooPurchasedCategory': __('Search categories'),
'selectWooPurchasedProduct': __('Search products'),
'selectWooCountry': __('Search countries'),
'selectWooPaymentMethods': __('Search payment methods'),
'selectWooShippingMethods': __('Search shipping methods'),
'woocommerce': _x('WooCommerce', 'Dynamic segment creation: User selects this to use any woocommerce filters'),
'dynamicSegmentSizeIsCalculated': __('Calculating segment size…'),
'dynamicSegmentSizeCalculatingTimeout': __("It's taking longer than usual to generate the segment, which may be due to a complex configuration. Try using fewer or simpler conditions."),
'dynamicSegmentSize': __('This segment has %1$d subscribers.'),
'learnMore': __('Learn more.'),
'unknownBadgeName': __('Unknown'),
'unknownBadgeTooltip': __('Not enough data.'),
'tooltipUnknown': __('Fewer than 3 emails sent'),
'excellentBadgeName': __('Excellent'),
'excellentBadgeTooltip': __('Congrats!'),
'tooltipExcellent': __('50% or more'),
'goodBadgeName': __('Good'),
'goodBadgeTooltip': __('Good stuff.'),
'tooltipGood': __('between 20 and 50%'),
'averageBadgeName': __('Low'),
'averageBadgeTooltip': __('Something to improve.'),
'tooltipAverage': __('20% or fewer'),
'engagementScoreDescription': __('Average percent of emails subscribers read in the last year'),
'addCondition': __('Add a condition'),
'privacyProtectionNotice': __('Due to email privacy protections, some opens may not be tracked. Consider using a different engagement metric.'),
'premiumFeatureMultipleConditions': __('Your current MailPoet plan does not support advanced segments with multiple conditions. Upgrade to the MailPoet Business plan to more precisely target your emails based on how people engage with your business. [link]Learn more.[/link]'),
'premiumBannerCtaFree': __('Upgrade'),
'premiumFeatureDescription': __('Your current MailPoet plan includes advanced features, but they require the MailPoet Premium plugin to be installed and activated.'),
'premiumFeatureButtonDownloadPremium': __('Download MailPoet Premium plugin'),
'premiumFeatureButtonActivatePremium': __('Activate MailPoet Premium plugin'),
'premiumFeatureDescriptionSubscribersLimitReached': __('Congratulations, you now have [subscribersCount] subscribers! Your plan is limited to [subscribersLimit] subscribers. You need to upgrade now to be able to continue using MailPoet.'),
'premiumFeatureButtonUpgradePlan': __('Upgrade your plan'),
}) %>