Translate cron, forms, newsletters, segments and subscribers

This commit is contained in:
Tautvidas Sipavičius
2016-03-23 11:09:34 +02:00
parent 74f3fa65cd
commit 7f6eed6d66
8 changed files with 74 additions and 35 deletions

View File

@@ -54,22 +54,22 @@ define(
}, },
render: function() { render: function() {
if(this.state.status === 'loading') { if(this.state.status === 'loading') {
return(<div>Loading daemon status...</div>); return(<div>{MailPoet.I18n.t('loadingDaemonStatus')}</div>);
} }
switch(this.state.status) { switch(this.state.status) {
case 'started': case 'started':
return( return(
<div> <div>
Cron daemon is running. {MailPoet.I18n.t('cronDaemonIsRunning')}
<br/> <br/>
<br/> <br/>
It was started {MailPoet.I18n.t('cronDaemonWasStarted')}
<strong> {this.state.timeSinceStart} </strong> and last executed <strong> {this.state.timeSinceStart} </strong> {MailPoet.I18n.t('cronDaemonLastExecuted')}
<strong> {this.state.timeSinceUpdate} </strong> for a total of <strong> {this.state.timeSinceUpdate} </strong> {MailPoet.I18n.t('cronDaemonRunningDuration')}
<strong> {this.state.counter} </strong> times (once every 30 seconds, unless it was interrupted and restarted). <strong> {this.state.counter} </strong> {MailPoet.I18n.t('cronDaemonExecutedTimes')}
<br /> <br />
<br /> <br />
<a href="#" className="button-primary" onClick={this.controlCron.bind(null, 'stop')}>Stop</a> <a href="#" className="button-primary" onClick={this.controlCron.bind(null, 'stop')}>{MailPoet.I18n.t('stop')}</a>
</div> </div>
); );
break; break;
@@ -77,17 +77,17 @@ define(
case 'stopping': case 'stopping':
return( return(
<div> <div>
Daemon is {this.state.status} {MailPoet.I18n.t('cronDaemonState').replace('%$1s', this.state.status)}
</div> </div>
); );
break; break;
case 'stopped': case 'stopped':
return( return(
<div> <div>
Daemon is {this.state.status} {MailPoet.I18n.t('cronDaemonState').replace('%$1s', this.state.status)}
<br /> <br />
<br /> <br />
<a href="#" className="button-primary" onClick={this.controlCron.bind(null, 'start')}>Start</a> <a href="#" className="button-primary" onClick={this.controlCron.bind(null, 'start')}>{MailPoet.I18n.t('Start')}</a>
</div> </div>
); );
break; break;

View File

@@ -8,17 +8,17 @@ import MailPoet from 'mailpoet'
const columns = [ const columns = [
{ {
name: 'name', name: 'name',
label: 'Name', label: MailPoet.I18n.t('formName'),
sortable: true sortable: true
}, },
{ {
name: 'segments', name: 'segments',
label: 'Lists', label: MailPoet.I18n.t('segments'),
sortable: false sortable: false
}, },
{ {
name: 'created_at', name: 'created_at',
label: 'Created on', label: MailPoet.I18n.t('createdOn'),
sortable: true sortable: true
} }
]; ];
@@ -30,11 +30,11 @@ const messages = {
if(count === 1) { if(count === 1) {
message = ( message = (
'1 form was moved to the trash.' MailPoet.I18n.t('oneFormTrashed')
); );
} else { } else {
message = ( message = (
'%$1d forms were moved to the trash.' MailPoet.I18n.t('multipleFormsTrashed')
).replace('%$1d', count); ).replace('%$1d', count);
} }
MailPoet.Notice.success(message); MailPoet.Notice.success(message);
@@ -45,11 +45,11 @@ const messages = {
if(count === 1) { if(count === 1) {
message = ( message = (
'1 form was permanently deleted.' MailPoet.I18n.t('oneFormDeleted')
); );
} else { } else {
message = ( message = (
'%$1d forms were permanently deleted.' MailPoet.I18n.t('multipleFormsDeleted')
).replace('%$1d', count); ).replace('%$1d', count);
} }
MailPoet.Notice.success(message); MailPoet.Notice.success(message);
@@ -60,11 +60,11 @@ const messages = {
if(count === 1) { if(count === 1) {
message = ( message = (
'1 form has been restored from the trash.' MailPoet.I18n.t('oneFormRestored')
); );
} else { } else {
message = ( message = (
'%$1d forms have been restored from the trash.' MailPoet.I18n.t('multipleFormsRestored')
).replace('%$1d', count); ).replace('%$1d', count);
} }
MailPoet.Notice.success(message); MailPoet.Notice.success(message);
@@ -74,16 +74,16 @@ const messages = {
const item_actions = [ const item_actions = [
{ {
name: 'edit', name: 'edit',
label: 'Edit', label: MailPoet.I18n.t('edit'),
link: function(item) { link: function(item) {
return ( return (
<a href={ `admin.php?page=mailpoet-form-editor&id=${item.id}` }>Edit</a> <a href={ `admin.php?page=mailpoet-form-editor&id=${item.id}` }>{MailPoet.I18n.t('edit')}</a>
); );
} }
}, },
{ {
name: 'duplicate_form', name: 'duplicate_form',
label: 'Duplicate', label: MailPoet.I18n.t('duplicate'),
onClick: function(item, refresh) { onClick: function(item, refresh) {
return MailPoet.Ajax.post({ return MailPoet.Ajax.post({
endpoint: 'forms', endpoint: 'forms',
@@ -91,7 +91,7 @@ const item_actions = [
data: item.id data: item.id
}).done(function(response) { }).done(function(response) {
MailPoet.Notice.success( MailPoet.Notice.success(
('Form "%$1s" has been duplicated.').replace('%$1s', response.name) (MailPoet.I18n.t('formDuplicated')).replace('%$1s', response.name)
); );
refresh(); refresh();
}); });
@@ -105,7 +105,7 @@ const item_actions = [
const bulk_actions = [ const bulk_actions = [
{ {
name: 'trash', name: 'trash',
label: 'Trash', label: MailPoet.I18n.t('trash'),
onSuccess: messages.onTrash onSuccess: messages.onTrash
} }
]; ];
@@ -142,10 +142,10 @@ const FormList = React.createClass({
</strong> </strong>
{ actions } { actions }
</td> </td>
<td className="column-format" data-colname="Lists"> <td className="column-format" data-colname={MailPoet.I18n.t('segments')}>
{ segments } { segments }
</td> </td>
<td className="column-date" data-colname="Created on"> <td className="column-date" data-colname={MailPoet.I18n.t('createdOn')}>
<abbr>{ MailPoet.Date.full(form.created_at) }</abbr> <abbr>{ MailPoet.Date.full(form.created_at) }</abbr>
</td> </td>
</div> </div>
@@ -155,11 +155,11 @@ const FormList = React.createClass({
return ( return (
<div> <div>
<h2 className="title"> <h2 className="title">
Forms <a {MailPoet.I18n.t('pageTitle')} <a
className="add-new-h2" className="add-new-h2"
href="javascript:;" href="javascript:;"
onClick={ this.createForm } onClick={ this.createForm }
>New</a> >{MailPoet.I18n.t('new')}</a>
</h2> </h2>
<Listing <Listing
@@ -179,4 +179,4 @@ const FormList = React.createClass({
} }
}); });
module.exports = FormList; module.exports = FormList;

View File

@@ -82,7 +82,7 @@ function(
<label <label
className="screen-reader-text" className="screen-reader-text"
htmlFor="bulk-action-selector-top"> htmlFor="bulk-action-selector-top">
Select bulk action {MailPoet.I18n.t('selectBulkAction')}
</label> </label>
<select <select
@@ -91,7 +91,7 @@ function(
value={ this.state.action } value={ this.state.action }
onChange={this.handleChangeAction} onChange={this.handleChangeAction}
> >
<option value="">Bulk Actions</option> <option value="">{MailPoet.I18n.t('bulkActions')}</option>
{ this.props.bulk_actions.map(function(action, index) { { this.props.bulk_actions.map(function(action, index) {
return ( return (
<option <option
@@ -114,4 +114,4 @@ function(
}); });
return ListingBulkActions; return ListingBulkActions;
}); });

View File

@@ -3,3 +3,18 @@
<% block content %> <% block content %>
<div id="cron_container"></div> <div id="cron_container"></div>
<% endblock %> <% endblock %>
<% block translations %>
<%= localize({
'daemonControlError': __('Cron daemon error'),
'loadingDaemonStatus': __('Loading daemon status...'),
'cronDaemonIsRunning': __('Cron daemon is running.'),
'cronDaemonWasStarted': __('It was started'),
'cronDaemonLastExecuted': __('and last executed'),
'cronDaemonRunningDuration': __('for a total of'),
'cronDaemonExecutedTimes': __('times (once every 30 seconds, unless it was interrupted and restarted).'),
'stop': __('Stop'),
'start': __('Start'),
'cronDaemonState': __('Cron is %$1s')
}) %>
<% endblock %>

View File

@@ -20,6 +20,24 @@
'selectedAllLabel': __('All %d forms are selected.'), 'selectedAllLabel': __('All %d forms are selected.'),
'selectAllLink': __('Select all forms on all pages.'), 'selectAllLink': __('Select all forms on all pages.'),
'clearSelection': __('Clear selection.'), 'clearSelection': __('Clear selection.'),
'permanentlyDeleted': __('%d forms permanently deleted.') 'permanentlyDeleted': __('%d forms permanently deleted.'),
'selectBulkAction': __('Select bulk action'),
'bulkActions': __('Bulk Actions'),
'apply': __('Apply'),
'formName': __('Name'),
'segments': __('Lists'),
'createdOn': __('Created on'),
'oneFormTrashed': __('1 form was moved to the trash.'),
'multipleFormsTrashed': __('%$1d forms were moved to the trash.'),
'oneFormDeleted': __('1 form was permanently deleted.'),
'multipleFormsDeleted': __('%$1d forms were permanently deleted.'),
'oneFormRestored': __('1 form has been restored from the trash.'),
'multipleFormsRestored': __('%$1d forms have been restored from the trash.'),
'edit': __('Edit'),
'duplicate': __('Duplicate'),
'formDuplicated': __('Form "%$1s" has been duplicated.'),
'trash': __('Trash'),
'new': __('New'),
}) %> }) %>
<% endblock %> <% endblock %>

View File

@@ -22,6 +22,9 @@
'selectAllLink': __('Select all newsletters on all pages.'), 'selectAllLink': __('Select all newsletters on all pages.'),
'clearSelection': __('Clear selection.'), 'clearSelection': __('Clear selection.'),
'permanentlyDeleted': __('%d newsletters permanently deleted.'), 'permanentlyDeleted': __('%d newsletters permanently deleted.'),
'selectBulkAction': __('Select bulk action'),
'bulkActions': __('Bulk Actions'),
'apply': __('Apply'),
'selectType': __('Select type'), 'selectType': __('Select type'),
'template': __('Template'), 'template': __('Template'),

View File

@@ -10,6 +10,6 @@
'searchLabel': __('Search'), 'searchLabel': __('Search'),
'loadingItems': __('Loading segments...'), 'loadingItems': __('Loading segments...'),
'noItemsFound': __('No segments found.'), 'noItemsFound': __('No segments found.'),
'permanentlyDeleted': __('%d segments permanently deleted.') 'permanentlyDeleted': __('%d segments permanently deleted.'),
}) %> }) %>
<% endblock %> <% endblock %>

View File

@@ -21,6 +21,9 @@
'selectedAllLabel': __('All %d subscribers are selected.'), 'selectedAllLabel': __('All %d subscribers are selected.'),
'selectAllLink': __('Select all subscribers on all pages.'), 'selectAllLink': __('Select all subscribers on all pages.'),
'clearSelection': __('Clear selection.'), 'clearSelection': __('Clear selection.'),
'permanentlyDeleted': __('%d subscribers permanently deleted.') 'permanentlyDeleted': __('%d subscribers permanently deleted.'),
'selectBulkAction': __('Select bulk action'),
'bulkActions': __('Bulk Actions'),
'apply': __('Apply'),
}) %> }) %>
<% endblock %> <% endblock %>