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() {
if(this.state.status === 'loading') {
return(<div>Loading daemon status...</div>);
return(<div>{MailPoet.I18n.t('loadingDaemonStatus')}</div>);
}
switch(this.state.status) {
case 'started':
return(
<div>
Cron daemon is running.
{MailPoet.I18n.t('cronDaemonIsRunning')}
<br/>
<br/>
It was started
<strong> {this.state.timeSinceStart} </strong> and last executed
<strong> {this.state.timeSinceUpdate} </strong> for a total of
<strong> {this.state.counter} </strong> times (once every 30 seconds, unless it was interrupted and restarted).
{MailPoet.I18n.t('cronDaemonWasStarted')}
<strong> {this.state.timeSinceStart} </strong> {MailPoet.I18n.t('cronDaemonLastExecuted')}
<strong> {this.state.timeSinceUpdate} </strong> {MailPoet.I18n.t('cronDaemonRunningDuration')}
<strong> {this.state.counter} </strong> {MailPoet.I18n.t('cronDaemonExecutedTimes')}
<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>
);
break;
@@ -77,17 +77,17 @@ define(
case 'stopping':
return(
<div>
Daemon is {this.state.status}
{MailPoet.I18n.t('cronDaemonState').replace('%$1s', this.state.status)}
</div>
);
break;
case 'stopped':
return(
<div>
Daemon is {this.state.status}
{MailPoet.I18n.t('cronDaemonState').replace('%$1s', this.state.status)}
<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>
);
break;

View File

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

View File

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