Localized strings

This commit is contained in:
Tomas Bures 2018-12-23 19:46:49 +00:00
parent 3d956ec141
commit 19fe5331d2
13 changed files with 123 additions and 80 deletions

View file

@ -117,14 +117,14 @@ export default class Statistics extends Component {
<div>
<Title>{t('campaignStatistics')}</Title>
{renderMetrics('total', t('Total'), false)}
{renderMetrics('delivered', t('Delivered'))}
{renderMetrics('blacklisted', t('Blacklisted'), false)}
{renderMetricsWithProgress('bounced', t('Bounced'), 'info')}
{renderMetricsWithProgress('complained', t('Complaints'), 'danger')}
{renderMetricsWithProgress('unsubscribed', t('Unsubscribed'), 'warning')}
{!entity.open_tracking_disabled && renderMetricsWithProgress('opened', t('Opened'), 'success')}
{!entity.click_tracking_disabled && renderMetricsWithProgress('clicks', t('Clicked'), 'success')}
{renderMetrics('total', t('total'), false)}
{renderMetrics('delivered', t('delivered'))}
{renderMetrics('blacklisted', t('blacklisted'), false)}
{renderMetricsWithProgress('bounced', t('bounced'), 'info')}
{renderMetricsWithProgress('complained', t('complaints'), 'danger')}
{renderMetricsWithProgress('unsubscribed', t('unsubscribed'), 'warning')}
{!entity.open_tracking_disabled && renderMetricsWithProgress('opened', t('opened'), 'success')}
{!entity.click_tracking_disabled && renderMetricsWithProgress('clicks', t('clicked'), 'success')}
</div>
);
}

View file

@ -36,14 +36,14 @@ export default class StatisticsLinkClicks extends Component {
const t = this.props.t;
const linksColumns = [
{ data: 0, title: t('URL'), render: data => <code>{data}</code> },
{ data: 1, title: t('Unique visitors') },
{ data: 2, title: t('Total clicks') }
{ data: 0, title: t('url'), render: data => <code>{data}</code> },
{ data: 1, title: t('uniqueVisitors') },
{ data: 2, title: t('totalClicks') }
];
return (
<div>
<Title>{t('Campaign links')}</Title>
<Title>{t('campaignLinks')}</Title>
<Table ref={node => this.table = node} withHeader dataUrl={`rest/campaigns-link-clicks-table/${this.props.entity.id}`} columns={linksColumns} />
</div>

View file

@ -99,12 +99,12 @@ export default class StatisticsOpened extends Component {
const stats = this.state.statisticsOpened;
const subscribersColumns = [
{ data: 0, title: t('Email') },
{ data: 0, title: t('email') },
{ data: 1, title: t('subscriptionId'), render: data => <code>{data}</code> },
{ data: 2, title: t('listId'), render: data => <code>{data}</code> },
{ data: 3, title: t('list') },
{ data: 4, title: t('listNamespace') },
{ data: 5, title: t('Opens count') }
{ data: 5, title: t('opensCount') }
];
console.log(this.state.statisticsOpened);
@ -117,8 +117,8 @@ export default class StatisticsOpened extends Component {
const navPills = (
<ul className={`nav nav-pills ${styles.navPills}`}>
{renderNavPill('countries', t('Countries'))}
{renderNavPill('devices', t('Devices'))}
{renderNavPill('countries', t('countries'))}
{renderNavPill('devices', t('devices'))}
</ul>
);
@ -126,28 +126,28 @@ export default class StatisticsOpened extends Component {
let charts = null;
const deviceTypes = {
desktop: t('Desktop'),
tv: t('TV'),
tablet: t('Tablet'),
phone: t('Phone'),
bot: t('Bot'),
car: t('Car'),
console: t('Console')
desktop: t('desktop'),
tv: t('tv'),
tablet: t('tablet'),
phone: t('phone'),
bot: t('bot'),
car: t('car'),
console: t('console')
};
if (agg === 'devices') {
charts = (
<div className={styles.charts}>
{navPills}
<h4 className={styles.chartTitle}>{t('Distribution by device type')}</h4>
<h4 className={styles.chartTitle}>{t('distributionByDeviceType')}</h4>
<Chart
width="100%"
height="380px"
chartType="PieChart"
loader={<div>{t('Loading chart')}</div>}
loader={<div>{t('loadingChart')}</div>}
data={[
[t('Device type'), t('Count')],
...stats.devices.map(entry => [deviceTypes[entry.key] || t('Unknown'), entry.count])
[t('deviceType'), t('count')],
...stats.devices.map(entry => [deviceTypes[entry.key] || t('unknown'), entry.count])
]}
options={{
chartArea: {
@ -174,17 +174,17 @@ export default class StatisticsOpened extends Component {
charts = (
<div className={styles.charts}>
{navPills}
<h4 className={styles.sectionTitle}>{t('Distribution by country')}</h4>
<h4 className={styles.sectionTitle}>{t('distributionByCountry')}</h4>
<div className="row">
<div className={`col-md-6 ${styles.chart}`}>
<Chart
width="100%"
height="380px"
chartType="PieChart"
loader={<div>{t('Loading chart')}</div>}
loader={<div>{t('loadingChart')}</div>}
data={[
[t('Country'), t('Count')],
...stats.countries.map(entry => [entry.key || t('Unknown'), entry.count])
[t('country'), t('count')],
...stats.countries.map(entry => [entry.key || t('unknown'), entry.count])
]}
options={{
chartArea: {
@ -213,7 +213,7 @@ export default class StatisticsOpened extends Component {
chartType="GeoChart"
data={[
['Country', 'Count'],
...stats.countries.map(entry => [entry.key || t('Unknown'), entry.count])
...stats.countries.map(entry => [entry.key || t('unknown'), entry.count])
]}
mapsApiKey={mailtrainConfig.mapsApiKey}
/>
@ -227,13 +227,13 @@ export default class StatisticsOpened extends Component {
return (
<div>
<Title>{t('Detailed Statistics')}</Title>
<Title>{t('detailedStatistics')}</Title>
{charts}
<hr/>
<h4 className={styles.sectionTitle}>{t('List of subscribers that opened the campaign')}</h4>
<h4 className={styles.sectionTitle}>{t('listOfSubscribersThatOpenedTheCampaign')}</h4>
<Table ref={node => this.table = node} withHeader dataUrl={`rest/campaigns-opens-table/${entity.id}`} columns={subscribersColumns} />
</div>
);

View file

@ -37,7 +37,7 @@ export default class StatisticsSubsList extends Component {
const t = this.props.t;
const subscribersColumns = [
{ data: 0, title: t('Email') },
{ data: 0, title: t('email') },
{ data: 1, title: t('subscriptionId'), render: data => <code>{data}</code> },
{ data: 2, title: t('listId'), render: data => <code>{data}</code> },
{ data: 3, title: t('list') },

View file

@ -217,8 +217,8 @@ class SendControls extends Component {
async resetAsync() {
const t = this.props.t;
this.actionDialog(
t('Confirm reset'),
t('Do you want to reset the campaign? All statistics and the track of delivered messages will be lost.'),
t('confirmReset'),
t('doYouWantToResetTheCampaign?All'),
async () => {
await this.postAndMaskStateError(`rest/campaign-reset/${this.props.entity.id}`);
await this.refreshEntity();
@ -479,7 +479,7 @@ export default class Status extends Component {
<Title>{t('campaignStatus')}</Title>
<AlignedRow label={t('name')}>{entity.name}</AlignedRow>
<AlignedRow label={t('Delivered')}>{entity.delivered}</AlignedRow>
<AlignedRow label={t('delivered')}>{entity.delivered}</AlignedRow>
<AlignedRow label={t('status')}>{this.campaignStatusLabels[entity.status]}</AlignedRow>
{sendSettings}

View file

@ -37,8 +37,8 @@ import StatisticsLinkClicks
function getMenus(t) {
const aggLabels = {
'countries': t('Countries'),
'devices': t('Devices')
'countries': t('countries'),
'devices': t('devices')
};
return {
@ -67,27 +67,27 @@ function getMenus(t) {
panelRender: props => <Statistics entity={props.resolved.campaign} />,
children: {
delivered: {
title: t('Delivered'),
title: t('delivered'),
link: params => `/campaigns/${params.campaignId}/statistics/delivered`,
panelRender: props => <StatisticsSubsList entity={props.resolved.campaign} title={t('Delivered Emails')} status={SubscriptionStatus.SUBSCRIBED} />
panelRender: props => <StatisticsSubsList entity={props.resolved.campaign} title={t('deliveredEmails')} status={SubscriptionStatus.SUBSCRIBED} />
},
complained: {
title: t('Complained'),
title: t('complained'),
link: params => `/campaigns/${params.campaignId}/statistics/complained`,
panelRender: props => <StatisticsSubsList entity={props.resolved.campaign} title={t('Subscribers that Complained')} status={SubscriptionStatus.COMPLAINED} />
panelRender: props => <StatisticsSubsList entity={props.resolved.campaign} title={t('subscribersThatComplained')} status={SubscriptionStatus.COMPLAINED} />
},
bounced: {
title: t('Bounced'),
title: t('bounced'),
link: params => `/campaigns/${params.campaignId}/statistics/bounced`,
panelRender: props => <StatisticsSubsList entity={props.resolved.campaign} title={t('Emails that Bounced')} status={SubscriptionStatus.BOUNCED} />
panelRender: props => <StatisticsSubsList entity={props.resolved.campaign} title={t('emailsThatBounced')} status={SubscriptionStatus.BOUNCED} />
},
unsubscribed: {
title: t('Unsubscribed'),
title: t('unsubscribed'),
link: params => `/campaigns/${params.campaignId}/statistics/unsubscribed`,
panelRender: props => <StatisticsSubsList entity={props.resolved.campaign} title={t('Subscribers that Unsubscribed')} status={SubscriptionStatus.UNSUBSCRIBED} />
panelRender: props => <StatisticsSubsList entity={props.resolved.campaign} title={t('subscribersThatUnsubscribed')} status={SubscriptionStatus.UNSUBSCRIBED} />
},
'opened': {
title: t('Opened'),
title: t('opened'),
resolve: {
statisticsOpened: params => `rest/campaign-statistics/${params.campaignId}/opened`
},
@ -101,7 +101,7 @@ function getMenus(t) {
}
},
'clicks': {
title: t('Clicks'),
title: t('clicks'),
link: params => `/campaigns/${params.campaignId}/statistics/clicks`,
panelRender: props => <StatisticsLinkClicks entity={props.resolved.campaign} />
}

View file

@ -216,7 +216,7 @@ export default class CUD extends Component {
<TextArea id="description" label={t('description')}/>
<InputField id="contact_email" label={t('contactEmail')} help={t('Contact email shown in the list subscription and management forms. If no contact email is given, the admin email from Global settings is used.')}/>
<InputField id="contact_email" label={t('contactEmail')} help={t('contactEmailShownInTheListSubscription')}/>
<InputField id="homepage" label={t('homepage')} help={t('homepageUrlUsedInSubscriptionFormsAnd')}/>
<InputField id="to_name" label={t('recipientsNameTemplate')} help={t('specifyUsingMergeTagsOfThisListHowTo')}/>
<TableSelect id="send_configuration" label={t('sendConfiguration')} withHeader dropdown dataUrl='rest/send-configurations-table' columns={sendConfigurationsColumns} selectionLabelIndex={1} help={t('sendConfigurationThatWillBeUsedFor')}/>

View file

@ -473,7 +473,7 @@ export default class CUD extends Component {
<AlignedRow>
<div className="help-block">
<small>
{t('Note: These links are solely for a quick preview. To get the address of the subscription form, go to the list\'s subscribers and click on "Subscription Form".')}
{t('noteTheseLinksAreSolelyForAQuickPreview')}
</small>
</div>
<p>
@ -504,7 +504,7 @@ export default class CUD extends Component {
<div className={this.state.previewFullscreen ? formsStyles.editorFullscreen : formsStyles.editor}>
<div className={formsStyles.navbar}>
{this.state.fullscreen && <img className={formsStyles.logo} src={getTrustedUrl('static/mailtrain-notext.png')}/>}
<div className={formsStyles.title}>{t('Form preview:') + ' ' + this.state.previewLabel}</div>
<div className={formsStyles.title}>{t('formPreview') + ' ' + this.state.previewLabel}</div>
<a className={formsStyles.btn} onClick={() => this.setState({previewContents: null, previewFullscreen: false})}><Icon icon="remove"/></a>
<a className={formsStyles.btn} onClick={() => this.setState({previewFullscreen: !this.state.previewFullscreen})}><Icon icon="fullscreen"/></a>
</div>

View file

@ -105,7 +105,7 @@ export default class ViewAndOutput extends Component {
if (this.state.report.state === ReportState.FINISHED) {
reportContent = viewType.getContent(this.state.content);
} else if (this.state.report.state === ReportState.SCHEDULED || this.state.report.state === ReportState.PROCESSING) {
reportContent = <div className="alert alert-info" role="alert">{t('Report is being generated')}</div>;
reportContent = <div className="alert alert-info" role="alert">{t('reportIsBeingGenerated')}</div>;
} else {
reportContent = <div className="alert alert-danger" role="alert">{t('reportNotGenerated')}</div>;
}
@ -113,7 +113,7 @@ export default class ViewAndOutput extends Component {
return (
<div>
<Toolbar>
<Button className="btn-primary" icon="repeat" label={t('Refresh')} onClickAsync={::this.refresh}/>
<Button className="btn-primary" icon="repeat" label={t('refresh')} onClickAsync={::this.refresh}/>
</Toolbar>
<Title>{viewType.getTitle(this.state.report.name)}</Title>

View file

@ -88,9 +88,9 @@ export default class List extends Component {
<Toolbar>
<DropdownMenu className="btn-primary" label={t('createReportTemplate')}>
<MenuLink to="/reports/templates/create">{t('blank')}</MenuLink>
<MenuLink to="/reports/templates/create/open-counts">{t('Open counts')}</MenuLink>
<MenuLink to="/reports/templates/create/open-counts-csv">{t('Open counts as CSV')}</MenuLink>
<MenuLink to="/reports/templates/create/aggregated-open-counts">{t('Aggregrated open counts')}</MenuLink>
<MenuLink to="/reports/templates/create/open-counts">{t('openCounts')}</MenuLink>
<MenuLink to="/reports/templates/create/open-counts-csv">{t('openCountsAsCsv')}</MenuLink>
<MenuLink to="/reports/templates/create/aggregated-open-counts">{t('aggregratedOpenCounts')}</MenuLink>
</DropdownMenu>
</Toolbar>
}

View file

@ -154,11 +154,11 @@ export function getMailerTypes(t) {
const zoneMtaTypeOptions = [];
if (mailtrainConfig.builtinZoneMTAEnabled) {
zoneMtaTypeOptions.push({ key: ZoneMTAType.BUILTIN, label: t('Built-in ZoneMTA')});
zoneMtaTypeOptions.push({ key: ZoneMTAType.BUILTIN, label: t('builtinZoneMta')});
}
zoneMtaTypeOptions.push({ key: ZoneMTAType.WITH_MAILTRAIN_HEADER_CONF, label: t('Dynamic configuration of DKIM keys via ZoneMTA\'s Mailtrain plugin (use this option for builtin ZoneMTA)')});
zoneMtaTypeOptions.push({ key: ZoneMTAType.WITH_HTTP_CONF, label: t('Dynamic configuration of DKIM keys via ZoneMTA\'s HTTP config plugin')});
zoneMtaTypeOptions.push({ key: ZoneMTAType.REGULAR, label: t('No dynamic configuration of DKIM keys')});
zoneMtaTypeOptions.push({ key: ZoneMTAType.WITH_MAILTRAIN_HEADER_CONF, label: t('dynamicConfigurationOfDkimKeysViaZoneMt')});
zoneMtaTypeOptions.push({ key: ZoneMTAType.WITH_HTTP_CONF, label: t('dynamicConfigurationOfDkimKeysViaZoneMt-1')});
zoneMtaTypeOptions.push({ key: ZoneMTAType.REGULAR, label: t('noDynamicConfigurationOfDkimKeys')});
mailerTypes[MailerType.GENERIC_SMTP] = {
typeName: typeNames[MailerType.GENERIC_SMTP],
@ -211,7 +211,7 @@ export function getMailerTypes(t) {
<div>
<Fieldset label={t('mailerSettings')}>
<Dropdown id="mailer_type" label={t('mailerType')} options={typeOptions}/>
<Dropdown id="zoneMtaType" label={t('Dynamic configuration')} options={zoneMtaTypeOptions}/>
<Dropdown id="zoneMtaType" label={t('dynamicConfiguration')} options={zoneMtaTypeOptions}/>
{(zoneMtaType === ZoneMTAType.REGULAR || zoneMtaType === ZoneMTAType.WITH_MAILTRAIN_HEADER_CONF || zoneMtaType === ZoneMTAType.WITH_HTTP_CONF) &&
<div>
<InputField id="smtpHostname" label={t('hostname')} placeholder={t('hostnameEgSmtpexamplecom')}/>

View file

@ -79,7 +79,7 @@ export default class Update extends Component {
<InputField id="defaultHomepage" label={t('defaultHomepageUrl')} help={t('thisUrlWillBeUsedInListSubscriptionForms')}/>
<InputField id="uaCode" label={t('trackingId')} placeholder={t('uaxxxxxxx')} help={t('enterGoogleAnalyticsTrackingCode')}/>
<InputField id="mapsApiKey" label={t('Google Maps API Key')} placeholder={t('XXXXXX')} help={t('The map overview in campaign statistics requires a Google Maps API key. Please enter it here. If no key is given, Google may throttle map requests, which will result in occassional unavailability of the map in the campaign statistics.')}/>
<InputField id="mapsApiKey" label={t('googleMapsApiKey')} placeholder={t('xxxxxx')} help={t('theMapOverviewInCampaignStatistics')}/>
<TextArea id="shoutout" label={t('frontpageShoutOut')} help={t('htmlCodeShownInTheFrontPageHeaderSection')}/>