diff --git a/assets/js/src/form/form.jsx b/assets/js/src/form/form.jsx index 717785c484..cdf8a744ce 100644 --- a/assets/js/src/form/form.jsx +++ b/assets/js/src/form/form.jsx @@ -167,7 +167,7 @@ define( ); } @@ -199,4 +199,4 @@ define( return Form; } -); \ No newline at end of file +); diff --git a/assets/js/src/i18n.js b/assets/js/src/i18n.js index 08ae45f629..215d7b7e0f 100644 --- a/assets/js/src/i18n.js +++ b/assets/js/src/i18n.js @@ -15,7 +15,7 @@ define('i18n', translations[key] = value; }, t: function(key) { - return translations[key] || 'TRANSLATION NOT FOUND'; + return translations[key] || 'TRANSLATION "%$1s" NOT FOUND'.replace("%$1s", key); }, all: function() { return translations; diff --git a/assets/js/src/listing/bulk_actions.jsx b/assets/js/src/listing/bulk_actions.jsx index 8a13b61a5e..10e74eb9e3 100644 --- a/assets/js/src/listing/bulk_actions.jsx +++ b/assets/js/src/listing/bulk_actions.jsx @@ -1,8 +1,10 @@ define([ - 'react' + 'react', + 'mailpoet' ], function( - React + React, + MailPoet ) { var ListingBulkActions = React.createClass({ getInitialState: function() { @@ -104,7 +106,7 @@ function( { this.state.extra } diff --git a/assets/js/src/listing/filters.jsx b/assets/js/src/listing/filters.jsx index 01ad26ed81..48482df579 100644 --- a/assets/js/src/listing/filters.jsx +++ b/assets/js/src/listing/filters.jsx @@ -1,10 +1,12 @@ define([ 'react', - 'jquery' + 'jquery', + 'mailpoet' ], function( React, - jQuery + jQuery, + MailPoet ) { var ListingFilters = React.createClass({ handleFilterAction: function() { @@ -69,7 +71,7 @@ function( id="post-query-submit" onClick={ this.handleFilterAction } type="submit" - defaultValue="Filter" + defaultValue={MailPoet.I18n.t('filter')} className="button" /> ); } @@ -80,7 +82,7 @@ function( ); diff --git a/assets/js/src/listing/header.jsx b/assets/js/src/listing/header.jsx index 39e32984fe..cbcd48cb3a 100644 --- a/assets/js/src/listing/header.jsx +++ b/assets/js/src/listing/header.jsx @@ -1,4 +1,12 @@ -define(['react', 'classnames'], function(React, classNames) { +define([ + 'react', + 'classnames', + 'mailpoet' + ], function( + React, + classNames, + MailPoet + ) { var ListingHeader = React.createClass({ handleSelectItems: function() { @@ -28,7 +36,7 @@ define(['react', 'classnames'], function(React, classNames) { - Trash + {MailPoet.I18n.t('trash')} ); @@ -145,7 +145,7 @@ define( } else { item_actions = ( - Edit + {MailPoet.I18n.t('edit')} ); } @@ -161,7 +161,7 @@ define( null, this.props.item.id )} - >Restore + >{MailPoet.I18n.t('restore')} { ' | ' } @@ -172,13 +172,13 @@ define( null, this.props.item.id )} - >Delete permanently + >{MailPoet.I18n.t('deletePermanently')} ); @@ -191,7 +191,7 @@ define( ); @@ -678,12 +678,12 @@ define( bulk_actions = [ { name: 'restore', - label: 'Restore', + label: MailPoet.I18n.t('restore'), onSuccess: this.props.messages.onRestore }, { name: 'delete', - label: 'Delete permanently', + label: MailPoet.I18n.t('deletePermanently'), onSuccess: this.props.messages.onDelete } ]; diff --git a/assets/js/src/listing/pages.jsx b/assets/js/src/listing/pages.jsx index 3cb404ccac..f885a9a44f 100644 --- a/assets/js/src/listing/pages.jsx +++ b/assets/js/src/listing/pages.jsx @@ -1,4 +1,12 @@ -define(['react', 'classnames'], function(React, classNames) { +define([ + 'react', + 'classnames', + 'mailpoet' + ], function( + React, + classNames, + MailPoet + ) { var ListingPages = React.createClass({ getInitialState: function() { @@ -72,7 +80,7 @@ define(['react', 'classnames'], function(React, classNames) { - Previous page + {MailPoet.I18n.t('previousPage')} ); @@ -83,7 +91,7 @@ define(['react', 'classnames'], function(React, classNames) { - First page + {MailPoet.I18n.t('firstPage')} ); @@ -94,7 +102,7 @@ define(['react', 'classnames'], function(React, classNames) { - Next page + {MailPoet.I18n.t('nextPage')} ); @@ -105,7 +113,7 @@ define(['react', 'classnames'], function(React, classNames) { - Last page + {MailPoet.I18n.t('lastPage')} ); @@ -125,7 +133,7 @@ define(['react', 'classnames'], function(React, classNames) { + htmlFor="current-page-selector">{MailPoet.I18n.t('currentPage')} -  of  +  {MailPoet.I18n.t('pageOutOf')}  {Math.ceil(this.props.count / this.props.limit)} @@ -158,7 +166,9 @@ define(['react', 'classnames'], function(React, classNames) { return (
- { this.props.count } items + { + MailPoet.I18n.t('numberOfItems').replace('%$1d', this.props.count) + } { pagination }
); @@ -167,4 +177,4 @@ define(['react', 'classnames'], function(React, classNames) { }); return ListingPages; -}); \ No newline at end of file +}); diff --git a/assets/js/src/listing/search.jsx b/assets/js/src/listing/search.jsx index 953605f42a..e0ba020d6a 100644 --- a/assets/js/src/listing/search.jsx +++ b/assets/js/src/listing/search.jsx @@ -24,7 +24,7 @@ define([

- Segment + {MailPoet.I18n.t('segment')}

Edit + {MailPoet.I18n.t('edit')} ); }, display: function(segment) { @@ -111,7 +111,7 @@ const item_actions = [ data: item.id }).done(function(response) { MailPoet.Notice.success( - ('List "%$1s" has been duplicated.').replace('%$1s', response.name) + (MailPoet.I18n.t('listDuplicated')).replace('%$1s', response.name) ); refresh(); }); @@ -122,7 +122,7 @@ const item_actions = [ }, { name: 'synchronize_segment', - label: 'Update', + label: MailPoet.I18n.t('update'), className: 'update', onClick: function(item, refresh) { MailPoet.Modal.loading(true); @@ -133,7 +133,7 @@ const item_actions = [ MailPoet.Modal.loading(false); if(response === true) { MailPoet.Notice.success( - ('List "%$1s" has been synchronized.').replace('%$1s', item.name) + (MailPoet.I18n.t('listSynchronized')).replace('%$1s', item.name) ); refresh(); } @@ -147,7 +147,7 @@ const item_actions = [ name: 'view_subscribers', link: function(item) { return ( - View subscribers + {MailPoet.I18n.t('viewSubscribers')} ); } }, @@ -199,7 +199,7 @@ const SegmentList = React.createClass({ return (

- Segments New + {MailPoet.I18n.t('pageTitle')} {MailPoet.I18n.t('new')}

- Subscriber + {MailPoet.I18n.t('subscriber')}

1) { message = ( - '%$1d subscribers were moved to the trash.' + MailPoet.I18n.t('multipleSubscribersTrashed') ).replace('%$1d', ~~response); } @@ -61,11 +61,11 @@ const messages = { var message = null; if(~~response === 1) { message = ( - '1 subscriber was permanently deleted.' + MailPoet.I18n.t('oneSubscriberDeleted') ); } else if(~~response > 1) { message = ( - '%$1d subscribers were permanently deleted.' + MailPoet.I18n.t('multipleSubscribersDeleted') ).replace('%$1d', ~~response); } @@ -79,11 +79,11 @@ const messages = { var message = null; if(~~response === 1) { message = ( - '1 subscriber has been restored from the trash.' + MailPoet.I18n.t('oneSubscriberRestored') ); } else if(~~response > 1) { message = ( - '%$1d subscribers have been restored from the trash.' + MailPoet.I18n.t('multipleSubscribersRestored') ).replace('%$1d', ~~response); } @@ -97,7 +97,7 @@ const messages = { const bulk_actions = [ { name: 'moveToList', - label: 'Move to list...', + label: MailPoet.I18n.t('moveToList'), onSelect: function() { let field = { id: 'move_to_segment', @@ -120,7 +120,7 @@ const bulk_actions = [ }, onSuccess: function(response) { MailPoet.Notice.success( - '%$1d subscribers were moved to list %$2s.' + MailPoet.I18n.t('multipleSubscribersMovedToList') .replace('%$1d', ~~response.subscribers) .replace('%$2s', response.segment) ); @@ -128,7 +128,7 @@ const bulk_actions = [ }, { name: 'addToList', - label: 'Add to list...', + label: MailPoet.I18n.t('addToList'), onSelect: function() { let field = { id: 'add_to_segment', @@ -151,7 +151,7 @@ const bulk_actions = [ }, onSuccess: function(response) { MailPoet.Notice.success( - '%$1d subscribers were added to list %$2s.' + MailPoet.I18n.t('multipleSubscribersAddedToList') .replace('%$1d', ~~response.subscribers) .replace('%$2s', response.segment) ); @@ -159,7 +159,7 @@ const bulk_actions = [ }, { name: 'removeFromList', - label: 'Remove from list...', + label: MailPoet.I18n.t('removeFromList'), onSelect: function() { let field = { id: 'remove_from_segment', @@ -182,7 +182,7 @@ const bulk_actions = [ }, onSuccess: function(response) { MailPoet.Notice.success( - '%$1d subscribers were removed from list %$2s.' + MailPoet.I18n.t('multipleSubscribersRemovedFromList') .replace('%$1d', ~~response.subscribers) .replace('%$2s', response.segment) ); @@ -190,37 +190,37 @@ const bulk_actions = [ }, { name: 'removeFromAllLists', - label: 'Remove from all lists', + label: MailPoet.I18n.t('removeFromAllLists'), onSuccess: function(response) { MailPoet.Notice.success( - '%$1d subscribers were removed from all lists.' + MailPoet.I18n.t('multipleSubscribersRemovedFromAllLists') .replace('%$1d', ~~response) ); } }, { name: 'confirmUnconfirmed', - label: 'Confirm unconfirmed', + label: MailPoet.I18n.t('confirmUnconfirmed'), onSuccess: function(response) { MailPoet.Notice.success( - '%$1d subscribers have been confirmed.' + MailPoet.I18n.t('multipleSubscribersConfirmed') .replace('%$1d', ~~response) ); } }, { name: 'sendConfirmationEmail', - label: 'Resend confirmation email', + label: MailPoet.I18n.t('resendConfirmationEmail'), onSuccess: function(response) { MailPoet.Notice.success( - '%$1d confirmation emails have been sent.' + MailPoet.I18n.t('multipleConfirmationEmailsSent') .replace('%$1d', ~~response) ); } }, { name: 'trash', - label: 'Trash', + label: MailPoet.I18n.t('trash'), onSuccess: messages.onTrash } ]; @@ -228,10 +228,10 @@ const bulk_actions = [ const item_actions = [ { name: 'edit', - label: 'Edit', + label: MailPoet.I18n.t('edit'), link: function(item) { return ( - Edit + {MailPoet.I18n.t('edit')} ); } }, @@ -262,15 +262,15 @@ const SubscriberList = React.createClass({ switch(subscriber.status) { case 'subscribed': - status = 'Subscribed'; + status = MailPoet.I18n.t('subscribed'); break; case 'unconfirmed': - status = 'Unconfirmed'; + status = MailPoet.I18n.t('unconfirmed'); break; case 'unsubscribed': - status = 'Unsubscribed'; + status = MailPoet.I18n.t('unsubscribed'); break; } @@ -302,7 +302,7 @@ const SubscriberList = React.createClass({ { unsubscribed_segments.join(', ') } @@ -334,16 +334,16 @@ const SubscriberList = React.createClass({

{ actions } - + { status } - + { segments } - + { MailPoet.Date.full(subscriber.created_at) } - + { MailPoet.Date.full(subscriber.updated_at) }
@@ -356,9 +356,9 @@ const SubscriberList = React.createClass({ return (

- Subscribers New - Import - Export + {MailPoet.I18n.t('pageTitle')} {MailPoet.I18n.t('new')} + {MailPoet.I18n.t('import')} + {MailPoet.I18n.t('export')}

<% endblock %> diff --git a/views/subscribers/subscribers.html b/views/subscribers/subscribers.html index bc94739abf..8529be5066 100644 --- a/views/subscribers/subscribers.html +++ b/views/subscribers/subscribers.html @@ -25,5 +25,61 @@ 'selectBulkAction': __('Select bulk action'), 'bulkActions': __('Bulk Actions'), 'apply': __('Apply'), + 'filter': __('Filter'), + 'emptyTrash': __('Empty Trash'), + 'selectAll': __('Select All'), + 'edit': __('Edit'), + 'restore': __('Restore'), + 'trash': __('Trash'), + 'deletePermanently': __('Delete Permanently'), + 'showMoreDetails': __('Show more details'), + 'previousPage': __('Previous page'), + 'firstPage': __('First page'), + 'nextPage': __('Next page'), + 'lastPage': __('Last page'), + 'currentPage': __('Current Page'), + 'pageOutOf': __('of'), + 'numberOfItems': __('%$1d items'), + 'email': __('E-mail'), + 'firstname': __('Firstname'), + 'lastname': __('Lastname'), + 'status': __('Status'), + 'unconfirmed': __('Unconfirmed'), + 'subscribed': __('Subscribed'), + 'unsubscribed': __('Unsubscribed'), + 'selectList': __('Select a list'), + 'unsubscribedAt': __('(Unsubscribed on %$1s)'), + 'subscriberUpdated': __('Subscriber successfully updated!'), + 'subscriberAdded': __('Subscriber successfully added!'), + + 'subscriber': __('Subscriber'), + 'status': __('Status'), + 'lists': __('Lists'), + 'subscribedOn': __('Subscribed on'), + 'lastModifiedOn': __('Last modified on'), + 'oneSubscriberTrashed': __('1 subscriber was moved to the trash.'), + 'multipleSubscribersTrashed': __('%$1d subscribers were moved to the trash.'), + 'oneSubscriberDeleted': __('1 subscriber was permanently deleted.'), + 'multipleSubscribersDeleted': __('%$1d subscribers were permanently deleted.'), + 'oneSubscriberRestored': __('1 subscriber has been restored from the trash.'), + 'multipleSubscribersRestored': __('%$1d subscribers have been restored from the trash.'), + 'moveToList': __('Move to list...'), + 'multipleSubscribersMovedToList': __('%$1d subscribers were moved to list %$2s.'), + 'addToList': __('Add to list...'), + 'multipleSubscribersAddedToList': __('%$1d subscribers were added to list %$2s.'), + 'removeFromList': __('Remove from list...'), + 'multipleSubscribersRemovedFromList': __('%$1d subscribers were removed from list %$2s.'), + 'removeFromAllLists': __('Remove from all lists'), + 'multipleSubscribersRemovedFromAllLists': __('%$1d subscribers were removed from all lists.'), + 'confirmUnconfirmed': __('Confirm unconfirmed'), + 'multipleSubscribersConfirmed': __('%$1d subscribers have been confirmed.'), + 'resendConfirmationEmail': __('Resend confirmation email'), + 'multipleConfirmationEmailsSent': __('%$1d confirmation emails have been sent.'), + 'listsToWhichSubscriberWasSubscribed': __('Lists to which the subscriber was subscribed.'), + 'new': __('New'), + 'import': __('Import'), + 'export': __('Export'), + 'save': __('Save'), + }) %> <% endblock %>