Skip to content

Commit

Permalink
Run codemod to add jetpack textdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham authored and simison committed Apr 1, 2019
1 parent d540f56 commit 8dd400b
Show file tree
Hide file tree
Showing 68 changed files with 446 additions and 343 deletions.
14 changes: 9 additions & 5 deletions extensions/blocks/business-hours/components/day-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DayEdit extends Component {
<div className={ classNames( day.name, 'business-hours__hours' ) }>
<TextControl
type="time"
label={ __( 'Opening' ) }
label={ __( 'Opening', 'jetpack' ) }
value={ opening }
className="business-hours__open"
placeholder={ defaultOpen }
Expand All @@ -33,7 +33,7 @@ class DayEdit extends Component {
/>
<TextControl
type="time"
label={ __( 'Closing' ) }
label={ __( 'Closing', 'jetpack' ) }
value={ closing }
className="business-hours__close"
placeholder={ defaultClose }
Expand All @@ -59,8 +59,12 @@ class DayEdit extends Component {
<div className="business-hours__row business-hours-row__add">
<div className={ classNames( day.name, 'business-hours__day' ) }>&nbsp;</div>
<div className={ classNames( day.name, 'business-hours__hours' ) }>
<IconButton isLink label={ __( 'Add Hours' ) } onClick={ this.addInterval }>
{ __( 'Add Hours' ) }
<IconButton
isLink
label={ __( 'Add Hours', 'jetpack' ) }
onClick={ this.addInterval }
>
{ __( 'Add Hours', 'jetpack' ) }
</IconButton>
</div>
<div className="business-hours__remove">&nbsp;</div>
Expand Down Expand Up @@ -166,7 +170,7 @@ class DayEdit extends Component {
<Fragment>
<span className="business-hours__day-name">{ localization.days[ day.name ] }</span>
<ToggleControl
label={ this.isClosed() ? __( 'Closed' ) : __( 'Open' ) }
label={ this.isClosed() ? __( 'Closed', 'jetpack' ) : __( 'Open', 'jetpack' ) }
checked={ ! this.isClosed() }
onChange={ this.toggleClosed }
/>
Expand Down
4 changes: 2 additions & 2 deletions extensions/blocks/business-hours/components/day-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DayPreview extends Component {
return (
<dd key={ key }>
{ sprintf(
_x( 'From %s to %s', 'from business opening hour to closing hour' ),
_x( 'From %s to %s', 'from business opening hour to closing hour', 'jetpack' ),
this.formatTime( interval.opening ),
this.formatTime( interval.closing )
) }
Expand All @@ -41,7 +41,7 @@ class DayPreview extends Component {
<Fragment>
<dt className={ day.name }>{ localization.days[ day.name ] }</dt>
{ isEmpty( hours ) ? (
<dd>{ _x( 'Closed', 'business is closed on a full day' ) }</dd>
<dd>{ _x( 'Closed', 'business is closed on a full day', 'jetpack' ) }</dd>
) : (
hours.map( this.renderInterval )
) }
Expand Down
16 changes: 8 additions & 8 deletions extensions/blocks/business-hours/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import { icon } from '.';

const defaultLocalization = {
days: {
Sun: __( 'Sunday' ),
Mon: __( 'Monday' ),
Tue: __( 'Tuesday' ),
Wed: __( 'Wednesday' ),
Thu: __( 'Thursday' ),
Fri: __( 'Friday' ),
Sat: __( 'Saturday' ),
Sun: __( 'Sunday', 'jetpack' ),
Mon: __( 'Monday', 'jetpack' ),
Tue: __( 'Tuesday', 'jetpack' ),
Wed: __( 'Wednesday', 'jetpack' ),
Thu: __( 'Thursday', 'jetpack' ),
Fri: __( 'Friday', 'jetpack' ),
Sat: __( 'Saturday', 'jetpack' ),
},
startOfWeek: 0,
};
Expand Down Expand Up @@ -63,7 +63,7 @@ class BusinessHours extends Component {
return (
<Placeholder
icon={ <BlockIcon icon={ icon } /> }
label={ __( 'Loading business hours' ) }
label={ __( 'Loading business hours', 'jetpack' ) }
/>
);
}
Expand Down
10 changes: 5 additions & 5 deletions extensions/blocks/business-hours/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ export const icon = renderMaterialIcon(
);

export const settings = {
title: __( 'Business Hours' ),
description: __( 'Display opening hours for your business.' ),
title: __( 'Business Hours', 'jetpack' ),
description: __( 'Display opening hours for your business.', 'jetpack' ),
icon,
category: 'jetpack',
supports: {
html: true,
},
keywords: [
_x( 'opening hours', 'block search term' ),
_x( 'closing time', 'block search term' ),
_x( 'schedule', 'block search term' ),
_x( 'opening hours', 'block search term', 'jetpack' ),
_x( 'closing time', 'block search term', 'jetpack' ),
_x( 'schedule', 'block search term', 'jetpack' ),
],
attributes: {
days: {
Expand Down
31 changes: 18 additions & 13 deletions extensions/blocks/contact-form/components/jetpack-contact-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ class JetpackContactForm extends Component {

getIntroMessage() {
return __(
'You’ll receive an email notification each time someone fills out the form. Where should it go, and what should the subject line be?'
'You’ll receive an email notification each time someone fills out the form. Where should it go, and what should the subject line be?',
'jetpack'
);
}

getEmailHelpMessage() {
return __( 'You can enter multiple email addresses separated by commas.' );
return __( 'You can enter multiple email addresses separated by commas.', 'jetpack' );
}

onChangeSubject( subject ) {
Expand Down Expand Up @@ -127,20 +128,23 @@ class JetpackContactForm extends Component {
if ( errors ) {
if ( errors.length === 1 ) {
if ( errors[ 0 ] && errors[ 0 ].email ) {
return sprintf( __( '%s is not a valid email address.' ), errors[ 0 ].email );
return sprintf( __( '%s is not a valid email address.', 'jetpack' ), errors[ 0 ].email );
}
return errors[ 0 ];
}

if ( errors.length === 2 ) {
return sprintf(
__( '%s and %s are not a valid email address.' ),
__( '%s and %s are not a valid email address.', 'jetpack' ),
errors[ 0 ].email,
errors[ 1 ].email
);
}
const inValidEmails = errors.map( error => error.email );
return sprintf( __( '%s are not a valid email address.' ), inValidEmails.join( ', ' ) );
return sprintf(
__( '%s are not a valid email address.', 'jetpack' ),
inValidEmails.join( ', ' )
);
}
return null;
}
Expand All @@ -162,8 +166,8 @@ class JetpackContactForm extends Component {
aria-describedby={ `contact-form-${ instanceId }-email-${
this.hasEmailError() ? 'error' : 'help'
}` }
label={ __( 'Email address' ) }
placeholder={ __( 'name@example.com' ) }
label={ __( 'Email address', 'jetpack' ) }
placeholder={ __( 'name@example.com', 'jetpack' ) }
onKeyDown={ this.preventEnterSubmittion }
value={ to }
onBlur={ this.onBlurTo }
Expand All @@ -177,9 +181,9 @@ class JetpackContactForm extends Component {
</HelpMessage>

<TextControl
label={ __( 'Email subject line' ) }
label={ __( 'Email subject line', 'jetpack' ) }
value={ subject }
placeholder={ __( "Let's work together" ) }
placeholder={ __( "Let's work together", 'jetpack' ) }
onChange={ this.onChangeSubject }
/>
</Fragment>
Expand All @@ -201,14 +205,14 @@ class JetpackContactForm extends Component {
return (
<Fragment>
<InspectorControls>
<PanelBody title={ __( 'Email feedback settings' ) }>
<PanelBody title={ __( 'Email feedback settings', 'jetpack' ) }>
{ this.renderToAndSubjectFields() }
</PanelBody>
</InspectorControls>
<div className={ formClassnames }>
{ ! hasFormSettingsSet && (
<Placeholder
label={ __( 'Form' ) }
label={ __( 'Form', 'jetpack' ) }
icon={ renderMaterialIcon(
<Path d="M13 7.5h5v2h-5zm0 7h5v2h-5zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM11 6H6v5h5V6zm-1 4H7V7h3v3zm1 3H6v5h5v-5zm-1 4H7v-3h3v3z" />
) }
Expand All @@ -218,12 +222,13 @@ class JetpackContactForm extends Component {
{ this.renderToAndSubjectFields() }
<p className="jetpack-contact-form__intro-message">
{ __(
'(If you leave these blank, notifications will go to the author with the post or page title as the subject line.)'
'(If you leave these blank, notifications will go to the author with the post or page title as the subject line.)',
'jetpack'
) }
</p>
<div className="jetpack-contact-form__create">
<Button isPrimary type="submit" disabled={ this.hasEmailError() }>
{ __( 'Add form' ) }
{ __( 'Add form', 'jetpack' ) }
</Button>
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ const JetpackFieldCheckbox = ( {
isSelected={ isSelected }
/>
<InspectorControls>
<PanelBody title={ __( 'Field Settings' ) }>
<PanelBody title={ __( 'Field Settings', 'jetpack' ) }>
<ToggleControl
label={ __( 'Default Checked State' ) }
label={ __( 'Default Checked State', 'jetpack' ) }
checked={ defaultValue }
onChange={ value => setAttributes( { defaultValue: value } ) }
/>
<TextControl
label={ __( 'ID' ) }
label={ __( 'ID', 'jetpack' ) }
value={ id }
onChange={ value => setAttributes( { id: value } ) }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ const JetpackFieldLabel = ( { setAttributes, label, resetFocus, isSelected, requ
resetFocus && resetFocus();
setAttributes( { label: value } );
} }
placeholder={ __( 'Write label…' ) }
placeholder={ __( 'Write label…', 'jetpack' ) }
/>
{ isSelected && (
<ToggleControl
label={ __( 'Required' ) }
label={ __( 'Required', 'jetpack' ) }
className="jetpack-field-label__required"
checked={ required }
onChange={ value => setAttributes( { required: value } ) }
/>
) }
{ ! isSelected && required && <span className="required">{ __( '(required)' ) }</span> }
{ ! isSelected && required && (
<span className="required">{ __( '(required)', 'jetpack' ) }</span>
) }
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,18 @@ class JetpackFieldMultiple extends Component {
<IconButton
className="jetpack-field-multiple__add-option"
icon="insert"
label={ __( 'Insert option' ) }
label={ __( 'Insert option', 'jetpack' ) }
onClick={ this.addNewOption }
>
{ __( 'Add option' ) }
{ __( 'Add option', 'jetpack' ) }
</IconButton>
) }
</BaseControl>

<InspectorControls>
<PanelBody title={ __( 'Field Settings' ) }>
<PanelBody title={ __( 'Field Settings', 'jetpack' ) }>
<TextControl
label={ __( 'ID' ) }
label={ __( 'ID', 'jetpack' ) }
value={ id }
onChange={ value => setAttributes( { id: value } ) }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ import { ToggleControl } from '@wordpress/components';
import { __ } from '../../../utils/i18n';

const JetpackFieldRequiredToggle = ( { required, onChange } ) => {
return <ToggleControl label={ __( 'Required' ) } checked={ required } onChange={ onChange } />;
return (
<ToggleControl
label={ __( 'Required', 'jetpack' ) }
checked={ required }
onChange={ onChange }
/>
);
};

export default JetpackFieldRequiredToggle;
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ function JetpackFieldTextarea( {
placeholder={ placeholder }
value={ placeholder }
onChange={ value => setAttributes( { placeholder: value } ) }
title={ __( 'Set the placeholder text' ) }
title={ __( 'Set the placeholder text', 'jetpack' ) }
/>
</div>
<InspectorControls>
<PanelBody title={ __( 'Field Settings' ) }>
<PanelBody title={ __( 'Field Settings', 'jetpack' ) }>
<TextControl
label={ __( 'Default Value' ) }
label={ __( 'Default Value', 'jetpack' ) }
value={ defaultValue }
onChange={ value => setAttributes( { defaultValue: value } ) }
/>
<TextControl
label={ __( 'ID' ) }
label={ __( 'ID', 'jetpack' ) }
value={ id }
onChange={ value => setAttributes( { id: value } ) }
/>
Expand Down
8 changes: 4 additions & 4 deletions extensions/blocks/contact-form/components/jetpack-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ function JetpackField( {
placeholder={ placeholder }
value={ placeholder }
onChange={ value => setAttributes( { placeholder: value } ) }
title={ __( 'Set the placeholder text' ) }
title={ __( 'Set the placeholder text', 'jetpack' ) }
/>
</div>
<InspectorControls>
<PanelBody title={ __( 'Field Settings' ) }>
<PanelBody title={ __( 'Field Settings', 'jetpack' ) }>
<TextControl
label={ __( 'Default Value' ) }
label={ __( 'Default Value', 'jetpack' ) }
value={ defaultValue }
onChange={ value => setAttributes( { defaultValue: value } ) }
/>
<TextControl
label={ __( 'ID' ) }
label={ __( 'ID', 'jetpack' ) }
value={ id }
onChange={ value => setAttributes( { id: value } ) }
/>
Expand Down
4 changes: 2 additions & 2 deletions extensions/blocks/contact-form/components/jetpack-option.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class JetpackOption extends Component {
type="text"
className="jetpack-option__input"
value={ option }
placeholder={ __( 'Write option…' ) }
placeholder={ __( 'Write option…', 'jetpack' ) }
onChange={ this.onChangeOption }
onKeyDown={ this.onKeyPress }
ref={ this.textInput }
Expand All @@ -68,7 +68,7 @@ class JetpackOption extends Component {
<IconButton
className="jetpack-option__remove"
icon="trash"
label={ __( 'Remove option' ) }
label={ __( 'Remove option', 'jetpack' ) }
onClick={ this.onDeleteOption }
/>
) }
Expand Down
Loading

0 comments on commit 8dd400b

Please sign in to comment.