Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forms: update copies from title case to sentence case and add translations #41086

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions projects/packages/forms/changelog/update-forms-sentence-case
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Forms: update copies from title case to sentence case
33 changes: 18 additions & 15 deletions projects/packages/forms/src/blocks/contact-form/child-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ const multiFieldV1 = fieldType => ( {
...FieldDefaults.attributes,
label: {
type: 'string',
default: fieldType === 'checkbox' ? 'Choose several options' : 'Choose one option',
default:
fieldType === 'checkbox'
? __( 'Choose several options', 'jetpack-forms' )
: __( 'Choose one option', 'jetpack-forms' ),
},
},
migrate: attributes => {
Expand Down Expand Up @@ -341,7 +344,7 @@ export const childBlocks = [
name: 'field-text',
settings: {
...FieldDefaults,
title: __( 'Text Input Field', 'jetpack-forms' ),
title: __( 'Text input field', 'jetpack-forms' ),
description: __( 'Collect short text responses from site visitors.', 'jetpack-forms' ),
icon: renderMaterialIcon(
<Path
Expand All @@ -354,7 +357,7 @@ export const childBlocks = [
...FieldDefaults.attributes,
label: {
type: 'string',
default: 'Text',
default: __( 'Text', 'jetpack-forms' ),
},
},
},
Expand All @@ -363,7 +366,7 @@ export const childBlocks = [
name: 'field-name',
settings: {
...FieldDefaults,
title: __( 'Name Field', 'jetpack-forms' ),
title: __( 'Name field', 'jetpack-forms' ),
description: __( 'Collect the site visitor’s name.', 'jetpack-forms' ),
icon: renderMaterialIcon(
<Path
Expand All @@ -376,7 +379,7 @@ export const childBlocks = [
...FieldDefaults.attributes,
label: {
type: 'string',
default: 'Name',
default: __( 'Name', 'jetpack-forms' ),
},
},
},
Expand All @@ -385,7 +388,7 @@ export const childBlocks = [
name: 'field-email',
settings: {
...FieldDefaults,
title: __( 'Email Field', 'jetpack-forms' ),
title: __( 'Email field', 'jetpack-forms' ),
keywords: [ __( 'e-mail', 'jetpack-forms' ), __( 'mail', 'jetpack-forms' ), 'email' ],
description: __( 'Collect email addresses from your visitors.', 'jetpack-forms' ),
icon: (
Expand All @@ -401,7 +404,7 @@ export const childBlocks = [
...FieldDefaults.attributes,
label: {
type: 'string',
default: 'Email',
default: __( 'Email', 'jetpack-forms' ),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Automattic/jetpack-vulcan any reason why default label values might've been untranslated? E.g. deprecation warnings between switching site locale?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea. I can't think of any reasons why it wouldn't be the case in a JS file.

},
},
},
Expand All @@ -410,7 +413,7 @@ export const childBlocks = [
name: 'field-url',
settings: {
...FieldDefaults,
title: __( 'Website Field', 'jetpack-forms' ),
title: __( 'Website field', 'jetpack-forms' ),
keywords: [
__( 'url', 'jetpack-forms' ),
__( 'internet page', 'jetpack-forms' ),
Expand Down Expand Up @@ -440,7 +443,7 @@ export const childBlocks = [
name: 'field-date',
settings: {
...FieldDefaults,
title: __( 'Date Picker', 'jetpack-forms' ),
title: __( 'Date picker', 'jetpack-forms' ),
keywords: [
__( 'Calendar', 'jetpack-forms' ),
_x( 'day month year', 'block search term', 'jetpack-forms' ),
Expand All @@ -458,7 +461,7 @@ export const childBlocks = [
...FieldDefaults.attributes,
label: {
type: 'string',
default: 'Date',
default: __( 'Date', 'jetpack-forms' ),
},
dateFormat: {
type: 'string',
Expand All @@ -471,7 +474,7 @@ export const childBlocks = [
name: 'field-telephone',
settings: {
...FieldDefaults,
title: __( 'Phone Number Field', 'jetpack-forms' ),
title: __( 'Phone number field', 'jetpack-forms' ),
keywords: [
__( 'Phone', 'jetpack-forms' ),
__( 'Cellular phone', 'jetpack-forms' ),
Expand All @@ -491,7 +494,7 @@ export const childBlocks = [
...FieldDefaults.attributes,
label: {
type: 'string',
default: 'Phone',
default: __( 'Phone', 'jetpack-forms' ),
},
},
},
Expand All @@ -500,7 +503,7 @@ export const childBlocks = [
name: 'field-textarea',
settings: {
...FieldDefaults,
title: __( 'Multi-line Text Field', 'jetpack-forms' ),
title: __( 'Multi-line text field', 'jetpack-forms' ),
keywords: [
__( 'Textarea', 'jetpack-forms' ),
'textarea',
Expand Down Expand Up @@ -547,7 +550,7 @@ export const childBlocks = [
name: 'field-consent',
settings: {
...FieldDefaults,
title: __( 'Terms Consent', 'jetpack-forms' ),
title: __( 'Terms consent', 'jetpack-forms' ),
keywords: [ __( 'Consent', 'jetpack-forms' ) ],
description: __(
'Communicate site terms and offer visitors consent to those terms.',
Expand Down Expand Up @@ -610,7 +613,7 @@ export const childBlocks = [
name: 'field-select',
settings: {
...FieldDefaults,
title: __( 'Dropdown Field', 'jetpack-forms' ),
title: __( 'Dropdown field', 'jetpack-forms' ),
keywords: [
__( 'Choose', 'jetpack-forms' ),
__( 'Dropdown', 'jetpack-forms' ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const JetpackDatePicker = props => {
index: 1,
element: (
<SelectControl
label={ __( 'Date Format', 'jetpack-forms' ) }
label={ __( 'Date format', 'jetpack-forms' ) }
options={ DATE_FORMATS.map( ( { value, label: optionLabel, example } ) => ( {
value,
label: `${ optionLabel } (${ example })`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default function JetpackFieldWidth( { setAttributes, width } ) {
className="jetpack-field-label__width"
__nextHasNoMarginBottom={ true }
>
<BaseControl.VisualLabel>{ __( 'Field Width', 'jetpack-forms' ) }</BaseControl.VisualLabel>
<ButtonGroup aria-label={ __( 'Field Width', 'jetpack-forms' ) }>
<BaseControl.VisualLabel>{ __( 'Field width', 'jetpack-forms' ) }</BaseControl.VisualLabel>
<ButtonGroup aria-label={ __( 'Field width', 'jetpack-forms' ) }>
{ [ 25, 50, 75, 100 ].map( widthValue => {
return (
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const JetpackManageResponsesSettings = () => {
return (
<>
<InspectorHint>
{ __( 'Manage and export your form responses in WPAdmin:', 'jetpack-forms' ) }
{ __( 'Manage and export your form responses in WP-Admin:', 'jetpack-forms' ) }
</InspectorHint>
<Button variant="secondary" href={ RESPONSES_PATH } target="_blank">
{ __( 'View Form Responses', 'jetpack-forms' ) }
{ __( 'View form responses', 'jetpack-forms' ) }
<span className="screen-reader-text">
{ __( '(opens in a new tab)', 'jetpack-forms' ) }
</span>
Expand Down
16 changes: 8 additions & 8 deletions projects/packages/forms/src/blocks/contact-form/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const JetpackContactFormEdit = forwardRef(
{ __( 'Customize the view after form submission:', 'jetpack-forms' ) }
</InspectorHint>
<SelectControl
label={ __( 'On Submission', 'jetpack-forms' ) }
label={ __( 'On submission', 'jetpack-forms' ) }
value={ customThankyou }
options={ [
{ label: __( 'Show a summary of submitted fields', 'jetpack-forms' ), value: '' },
Expand All @@ -179,7 +179,7 @@ export const JetpackContactFormEdit = forwardRef(

{ 'redirect' !== customThankyou && (
<TextControl
label={ __( 'Message Heading', 'jetpack-forms' ) }
label={ __( 'Message heading', 'jetpack-forms' ) }
value={ customThankyouHeading }
placeholder={ __( 'Your message has been sent', 'jetpack-forms' ) }
onChange={ newHeading => setAttributes( { customThankyouHeading: newHeading } ) }
Expand All @@ -189,7 +189,7 @@ export const JetpackContactFormEdit = forwardRef(

{ 'message' === customThankyou && (
<TextareaControl
label={ __( 'Message Text', 'jetpack-forms' ) }
label={ __( 'Message text', 'jetpack-forms' ) }
value={ customThankyouMessage }
placeholder={ __( 'Thank you for your submission!', 'jetpack-forms' ) }
onChange={ newMessage => setAttributes( { customThankyouMessage: newMessage } ) }
Expand All @@ -200,7 +200,7 @@ export const JetpackContactFormEdit = forwardRef(
{ 'redirect' === customThankyou && (
<div>
<URLInput
label={ __( 'Redirect Address', 'jetpack-forms' ) }
label={ __( 'Redirect address', 'jetpack-forms' ) }
value={ customThankyouRedirect }
className="jetpack-contact-form__thankyou-redirect-url"
onChange={ newURL => setAttributes( { customThankyouRedirect: newURL } ) }
Expand Down Expand Up @@ -228,7 +228,7 @@ export const JetpackContactFormEdit = forwardRef(
/>
<div className="form-placeholder__footer">
<Button variant="secondary" onClick={ () => setIsPatternsModalOpen( true ) }>
{ __( 'Explore Form Patterns', 'jetpack-forms' ) }
{ __( 'Explore form patterns', 'jetpack-forms' ) }
</Button>
<div className="form-placeholder__footer-links">
<Button
Expand Down Expand Up @@ -299,13 +299,13 @@ export const JetpackContactFormEdit = forwardRef(
</Notice>{ ' ' }
</PanelBody>
) }
<PanelBody title={ __( 'Manage Responses', 'jetpack-forms' ) }>
<PanelBody title={ __( 'Manage responses', 'jetpack-forms' ) }>
<JetpackManageResponsesSettings setAttributes={ setAttributes } />
</PanelBody>
<PanelBody title={ __( 'Submission Settings', 'jetpack-forms' ) } initialOpen={ false }>
<PanelBody title={ __( 'Submission settings', 'jetpack-forms' ) } initialOpen={ false }>
{ renderSubmissionSettings() }
</PanelBody>
<PanelBody title={ __( 'Email Connection', 'jetpack-forms' ) }>
<PanelBody title={ __( 'Email connection', 'jetpack-forms' ) }>
<JetpackEmailConnectionSettings
emailAddress={ to }
emailSubject={ subject }
Expand Down
6 changes: 3 additions & 3 deletions projects/packages/forms/src/blocks/contact-form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ export const settings = {
],
},
styles: [
{ name: 'default', label: 'Default', isDefault: true },
{ name: 'animated', label: 'Animated' },
{ name: 'outlined', label: 'Outlined' },
{ name: 'default', label: __( 'Default', 'jetpack-forms' ), isDefault: true },
{ name: 'animated', label: __( 'Animated', 'jetpack-forms' ) },
{ name: 'outlined', label: __( 'Outlined', 'jetpack-forms' ) },
// Need to figure out some details. Putting on hold for now
// { name: 'below', label: 'Below' },
],
Expand Down
Loading