Add translations for create custom field form

[MAILPOET-2463]
This commit is contained in:
Rostislav Wolny
2020-01-14 14:33:54 +01:00
committed by Pavel Dohnal
parent d319781e34
commit 9f17bf38af
3 changed files with 14 additions and 7 deletions

View File

@ -1,11 +1,12 @@
import MailPoet from 'mailpoet';
import Icon from './icon.jsx'; import Icon from './icon.jsx';
import Edit from './edit.jsx'; import Edit from './edit.jsx';
export const name = 'mailpoet-form/add-custom-field'; export const name = 'mailpoet-form/add-custom-field';
export const settings = { export const settings = {
title: 'Create Custom Field', title: MailPoet.I18n.t('blockAddCustomField'),
description: 'Create a new custom field for your subscribers.', description: MailPoet.I18n.t('blockAddCustomFieldDescription'),
icon: Icon, icon: Icon,
category: 'custom-fields', category: 'custom-fields',
attributes: { attributes: {

View File

@ -115,7 +115,7 @@ const AddCustomField = ({ clientId }) => {
return ( return (
<Placeholder <Placeholder
icon={<BlockIcon icon={icon} showColors />} icon={<BlockIcon icon={icon} showColors />}
label="New Custom Field" label={MailPoet.I18n.t('blockAddCustomFieldFormHeading')}
> >
{!isCreating ? ( {!isCreating ? (
<> <>
@ -123,7 +123,7 @@ const AddCustomField = ({ clientId }) => {
<div className="mailpoet_custom_field_add_form"> <div className="mailpoet_custom_field_add_form">
<hr /> <hr />
<SelectControl <SelectControl
label="Select a field type" label={MailPoet.I18n.t('selectCustomFieldType')}
options={customFieldTypes} options={customFieldTypes}
onChange={(value) => { onChange={(value) => {
setFieldSettings(null); setFieldSettings(null);
@ -131,7 +131,7 @@ const AddCustomField = ({ clientId }) => {
}} }}
/> />
<TextControl <TextControl
label="Field name" label={MailPoet.I18n.t('customFieldName')}
onChange={setFieldName} onChange={setFieldName}
/> />
<hr /> <hr />
@ -149,7 +149,7 @@ const AddCustomField = ({ clientId }) => {
createCustomField(data, clientId); createCustomField(data, clientId);
}} }}
> >
{'Create'} {MailPoet.I18n.t('blockCreateButton')}
</Button> </Button>
</div> </div>
</> </>

View File

@ -100,7 +100,13 @@
'blockCustomHtmlDescription': __('Display custom text or HTML code in your form.'), 'blockCustomHtmlDescription': __('Display custom text or HTML code in your form.'),
'blockCustomHtmlDefault': __('Subscribe to our newsletter and join [mailpoet_subscribers_count] other subscribers.'), 'blockCustomHtmlDefault': __('Subscribe to our newsletter and join [mailpoet_subscribers_count] other subscribers.'),
'blockCustomHtmlContentLabel': _x('Custom text', 'Textarea label'), 'blockCustomHtmlContentLabel': _x('Custom text', 'Textarea label'),
'blockCustomHtmlNl2br': __('Automatically add paragraphs') 'blockCustomHtmlNl2br': __('Automatically add paragraphs'),
'blockAddCustomField': __('Create Custom Field'),
'blockAddCustomFieldDescription': __('Create a new custom field for your subscribers.'),
'blockAddCustomFieldFormHeading': __('New Custom Field.'),
'blockCreateButton': __('Create'),
'customFieldName': _x('Field name', 'Label for form field for custom input name'),
'selectCustomFieldType': _x('Select a field type', 'Label for form field for custom input type')
}) %> }) %>
<% endblock %> <% endblock %>