From 609112c93461ec303d4a2f11b6846304886ab3ed Mon Sep 17 00:00:00 2001 From: Igor Zinovyev Date: Tue, 14 Feb 2017 22:34:55 +0300 Subject: [PATCH 1/2] Fixed concatenated strings and added context where needed. --- _inc/client/at-a-glance/connections.jsx | 27 ++++++++++++++++--- .../components/connect-button/index.jsx | 4 +-- _inc/client/components/dash-item/index.jsx | 4 +-- .../components/module-settings/index.jsx | 4 +-- .../components/navigation-settings/index.jsx | 2 +- _inc/client/pro-status/index.jsx | 16 +++++------ _inc/client/traffic/related-posts.jsx | 4 ++- 7 files changed, 42 insertions(+), 19 deletions(-) diff --git a/_inc/client/at-a-glance/connections.jsx b/_inc/client/at-a-glance/connections.jsx index 83fddf315259f..1d26b82be3bbb 100644 --- a/_inc/client/at-a-glance/connections.jsx +++ b/_inc/client/at-a-glance/connections.jsx @@ -120,7 +120,22 @@ export const DashConnections = React.createClass( {
gravatar
- { __( 'Connected as ' ) }{ this.props.userWpComLogin } + { + __( + 'Connected as {{span}}%(username)s{{/span}}', + { + args: { + username: this.props.userWpComLogin, + }, + components: { + span: + }, + comment: '%(username) is the WordPress user login name.' + } + ) + }
{ this.props.userWpComEmail }
@@ -155,14 +170,20 @@ export const DashConnections = React.createClass( {
- + { this.siteConnection() }
- + { this.userConnection() }
diff --git a/_inc/client/components/connect-button/index.jsx b/_inc/client/components/connect-button/index.jsx index dc66b51c272a0..a2498863de0a3 100644 --- a/_inc/client/components/connect-button/index.jsx +++ b/_inc/client/components/connect-button/index.jsx @@ -75,7 +75,7 @@ export const ConnectButton = React.createClass( { className="jp-connection-settings__cancel" onClick={ this.handleCloseModal }> { - __( 'Cancel' ) + __( 'Cancel', { context: 'A caption for a button to cancel disconnection.' } ) }
diff --git a/_inc/client/components/dash-item/index.jsx b/_inc/client/components/dash-item/index.jsx index 88620a0938632..970cb9bf0fa3a 100644 --- a/_inc/client/components/dash-item/index.jsx +++ b/_inc/client/components/dash-item/index.jsx @@ -78,7 +78,7 @@ export const DashItem = React.createClass( { status={ this.props.status } isCompact={ true } > - { __( 'Updates Needed' ) } + { __( 'Updates Needed', { context: 'Short warning message' } ) } ); @@ -95,7 +95,7 @@ export const DashItem = React.createClass( { compact={ true } href="#/plans" > - { __( 'Paid' ) } + { __( 'Paid', { context: 'Short label appearing near a paid feature configuration block.' } ) } ; diff --git a/_inc/client/components/module-settings/index.jsx b/_inc/client/components/module-settings/index.jsx index 53b8418858c3e..dcb687648567d 100644 --- a/_inc/client/components/module-settings/index.jsx +++ b/_inc/client/components/module-settings/index.jsx @@ -77,7 +77,7 @@ export let RelatedPostsSettings = React.createClass( {
{ show_headline ? -
{ __( 'Related' ) }
: +
{ __( 'Related', { context: 'A header for a block of related posts.' } ) }
: '' } { @@ -118,7 +118,7 @@ export let RelatedPostsSettings = React.createClass( { name={ 'show_thumbnails' } label={ __( 'Use a large and visually striking layout' ) } { ...this.props } /> -
{ __( 'Preview' ) }
+
{ __( 'Preview', { context: 'Noun, a header for a preview block in a configuration screen.' } ) }
{ this.renderPreviews() } diff --git a/_inc/client/components/navigation-settings/index.jsx b/_inc/client/components/navigation-settings/index.jsx index 8847c6f66c2b7..a977581228b6e 100644 --- a/_inc/client/components/navigation-settings/index.jsx +++ b/_inc/client/components/navigation-settings/index.jsx @@ -97,7 +97,7 @@ export const NavigationSettings = React.createClass( { ? 'https://wordpress.com/sharing/' + this.props.siteRawUrl : this.props.siteAdminUrl + 'options-general.php?page=sharing' }> - { __( 'Sharing' ) } + { __( 'Sharing', { context: 'Navigation item.' } ) } { true === this.props.siteConnectionStatus && ( diff --git a/_inc/client/pro-status/index.jsx b/_inc/client/pro-status/index.jsx index c6f1026fc3ce6..c2a4fb3618c16 100644 --- a/_inc/client/pro-status/index.jsx +++ b/_inc/client/pro-status/index.jsx @@ -67,7 +67,7 @@ const ProStatus = React.createClass( { status='is-error' isCompact={ true } > - { __( 'Threats found!' ) } + { __( 'Threats found!', { context: 'Short warning message about new threats found.' } ) } ); } @@ -82,7 +82,7 @@ const ProStatus = React.createClass( { status='is-warning' isCompact={ true } > - { __( 'Invalid Key' ) } + { __( 'Invalid Key', { context: 'Short warning message about an invalid key being used for Akismet.' } ) } ); @@ -100,7 +100,7 @@ const ProStatus = React.createClass( { primary={ true } href={ 'https://jetpack.com/redirect/?source=upgrade-seo&site=' + this.props.siteRawUrl + '&feature=advanced-seo' } > - { __( 'Upgrade' ) } + { __( 'Upgrade', { context: 'Caption for a button to purchase a paid feature.' } ) } ); } @@ -116,7 +116,7 @@ const ProStatus = React.createClass( { primary={ true } href={ 'https://jetpack.com/redirect/?source=upgrade-ads&site=' + this.props.siteRawUrl + '&feature=jetpack-ads' } > - { __( 'Upgrade' ) } + { __( 'Upgrade', { context: 'Caption for a button to purchase a paid feature.' } ) } ); } @@ -132,7 +132,7 @@ const ProStatus = React.createClass( { primary={ true } href={ 'https://jetpack.com/redirect/?source=upgrade-google-analytics&site=' + this.props.siteRawUrl + '&feature=google-analytics' } > - { __( 'Upgrade' ) } + { __( 'Upgrade', { context: 'Caption for a button to purchase a paid feature.' } ) } ); } @@ -142,7 +142,7 @@ const ProStatus = React.createClass( { if ( 'jetpack_free' !== sitePlan.product_slug ) { btnVals = { href: `https://wordpress.com/plugins/setup/${ this.props.siteRawUrl }?only=${ feature }`, - text: __( 'Set up' ) + text: __( 'Set up', { context: 'Caption for a button to set up a feature.' } ) } if ( 'scan' === feature && ! hasBusiness && ! hasPremium ) { @@ -152,14 +152,14 @@ const ProStatus = React.createClass( { primary={ true } href={ 'https://jetpack.com/redirect/?source=upgrade&site=' + this.props.siteRawUrl } > - { __( 'Upgrade' ) } + { __( 'Upgrade', { context: 'Caption for a button to purchase a paid feature.' } ) } ); } } else { btnVals = { href: 'https://jetpack.com/redirect/?source=upgrade&site=' + this.props.siteRawUrl, - text: __( 'Upgrade' ) + text: __( 'Upgrade', { context: 'Caption for a button to purchase a paid feature.' } ) } } diff --git a/_inc/client/traffic/related-posts.jsx b/_inc/client/traffic/related-posts.jsx index dbce012c5a24e..4b51ca8ed5840 100644 --- a/_inc/client/traffic/related-posts.jsx +++ b/_inc/client/traffic/related-posts.jsx @@ -102,7 +102,9 @@ export const RelatedPosts = moduleSettingsForm( } } ) } - { __( 'Preview' ) } + + { __( 'Preview', { context: 'A header for a preview area in the configuration screen.' } ) } + { this.state.show_headline && ( From ed033a2a9d2d31a5ac5c51fa5b03d510daf6b722 Mon Sep 17 00:00:00 2001 From: Derek Smart Date: Wed, 15 Feb 2017 14:58:28 -0500 Subject: [PATCH 2/2] use sentence case --- _inc/client/at-a-glance/akismet.jsx | 2 +- _inc/client/at-a-glance/connections.jsx | 4 ++-- _inc/client/components/dash-item/index.jsx | 2 +- _inc/client/pro-status/index.jsx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_inc/client/at-a-glance/akismet.jsx b/_inc/client/at-a-glance/akismet.jsx index 3eccb45cd5632..35bc22d3d2c55 100644 --- a/_inc/client/at-a-glance/akismet.jsx +++ b/_inc/client/at-a-glance/akismet.jsx @@ -98,7 +98,7 @@ const DashAkismet = React.createClass( { module="akismet" className="jp-dash-item__is-inactive" status="is-warning" - statusText={ __( 'Invalid Key' ) } + statusText={ __( 'Invalid key' ) } pro={ true } siteAdminUrl={ this.props.siteAdminUrl } > diff --git a/_inc/client/at-a-glance/connections.jsx b/_inc/client/at-a-glance/connections.jsx index 1d26b82be3bbb..5e23ed88f514d 100644 --- a/_inc/client/at-a-glance/connections.jsx +++ b/_inc/client/at-a-glance/connections.jsx @@ -172,7 +172,7 @@ export const DashConnections = React.createClass( {
{ this.siteConnection() } @@ -182,7 +182,7 @@ export const DashConnections = React.createClass( {
{ this.userConnection() } diff --git a/_inc/client/components/dash-item/index.jsx b/_inc/client/components/dash-item/index.jsx index 970cb9bf0fa3a..fcbce81d75d33 100644 --- a/_inc/client/components/dash-item/index.jsx +++ b/_inc/client/components/dash-item/index.jsx @@ -78,7 +78,7 @@ export const DashItem = React.createClass( { status={ this.props.status } isCompact={ true } > - { __( 'Updates Needed', { context: 'Short warning message' } ) } + { __( 'Updates needed', { context: 'Short warning message' } ) } ); diff --git a/_inc/client/pro-status/index.jsx b/_inc/client/pro-status/index.jsx index c2a4fb3618c16..bcae45520eb94 100644 --- a/_inc/client/pro-status/index.jsx +++ b/_inc/client/pro-status/index.jsx @@ -82,7 +82,7 @@ const ProStatus = React.createClass( { status='is-warning' isCompact={ true } > - { __( 'Invalid Key', { context: 'Short warning message about an invalid key being used for Akismet.' } ) } + { __( 'Invalid key', { context: 'Short warning message about an invalid key being used for Akismet.' } ) } );