diff --git a/client/mailing-lists/main.jsx b/client/mailing-lists/main.jsx index dab76a51ddf05..77e08d04f1260 100644 --- a/client/mailing-lists/main.jsx +++ b/client/mailing-lists/main.jsx @@ -4,6 +4,7 @@ import page from 'page'; import React from 'react'; import Gridicon from 'gridicons'; +import { localize } from 'i18n-calypso'; /** * Internal dependencies @@ -49,7 +50,7 @@ const MainComponent = React.createClass( { }, getSubscribedMessage() { - return this.translate( 'Subscribed to {{em}}%(categoryName)s{{/em}}', { + return this.props.translate( 'Subscribed to {{em}}%(categoryName)s{{/em}}', { args: { categoryName: this.getCategoryName() }, @@ -60,7 +61,7 @@ const MainComponent = React.createClass( { }, getUnsubscribedMessage() { - return this.translate( 'Unsubscribed from {{em}}%(categoryName)s{{/em}}', { + return this.props.translate( 'Unsubscribed from {{em}}%(categoryName)s{{/em}}', { args: { categoryName: this.getCategoryName() }, @@ -71,7 +72,7 @@ const MainComponent = React.createClass( { }, getSubscribedErrorMessage() { - return this.translate( 'Error subscribing to {{em}}%(categoryName)s{{/em}} mailing list! Try again later.', { + return this.props.translate( 'Error subscribing to {{em}}%(categoryName)s{{/em}} mailing list! Try again later.', { args: { categoryName: this.getCategoryName() }, @@ -82,7 +83,7 @@ const MainComponent = React.createClass( { }, getUnsubscribedErrorMessage() { - return this.translate( 'Error unsubscribing from {{em}}%(categoryName)s{{/em}} mailing list! Try again later.', { + return this.props.translate( 'Error unsubscribing from {{em}}%(categoryName)s{{/em}} mailing list! Try again later.', { args: { categoryName: this.getCategoryName() }, @@ -94,13 +95,13 @@ const MainComponent = React.createClass( { getCategoryName() { if ( 'marketing' === this.props.category ) { - return this.translate( 'Suggestions' ); + return this.props.translate( 'Suggestions' ); } else if ( 'research' === this.props.category ) { - return this.translate( 'Research' ); + return this.props.translate( 'Research' ); } else if ( 'community' === this.props.category ) { - return this.translate( 'Community' ); + return this.props.translate( 'Community' ); } else if ( 'digest' === this.props.category ) { - return this.translate( 'Digests' ); + return this.props.translate( 'Digests' ); } return this.props.category; @@ -108,13 +109,13 @@ const MainComponent = React.createClass( { getCategoryDescription() { if ( 'marketing' === this.props.category ) { - return this.translate( 'Tips for getting the most out of WordPress.com.' ); + return this.props.translate( 'Tips for getting the most out of WordPress.com.' ); } else if ( 'research' === this.props.category ) { - return this.translate( 'Opportunities to participate in WordPress.com research and surveys.' ); + return this.props.translate( 'Opportunities to participate in WordPress.com research and surveys.' ); } else if ( 'community' === this.props.category ) { - return this.translate( 'Information on WordPress.com courses and events (online and in-person).' ); + return this.props.translate( 'Information on WordPress.com courses and events (online and in-person).' ); } else if ( 'digest' === this.props.category ) { - return this.translate( 'Popular content from the blogs you follow, and reports on your own site and its performance.' ); + return this.props.translate( 'Popular content from the blogs you follow, and reports on your own site and its performance.' ); } return null; @@ -143,12 +144,13 @@ const MainComponent = React.createClass( { }, render() { + const translate = this.props.translate; var headingLabel = this.state.isSubscribed - ? this.translate( 'You\'re subscribed' ) - : this.translate( 'We\'ve unsubscribed your email.' ), + ? translate( 'You\'re subscribed' ) + : translate( 'We\'ve unsubscribed your email.' ), messageLabel = this.state.isSubscribed - ? this.translate( 'We\'ll send you updates for this mailing list.' ) - : this.translate( 'You will no longer receive updates for this mailing list.' ); + ? translate( 'We\'ll send you updates for this mailing list.' ) + : translate( 'You will no longer receive updates for this mailing list.' ); return(
@@ -165,14 +167,22 @@ const MainComponent = React.createClass( {

{ this.getCategoryName() }

{ this.getCategoryDescription() }

{ this.state.isSubscribed - ? - : } + ? + : } -

+

+ +

); } } ); -export default MainComponent; +export default localize( MainComponent ); diff --git a/client/me/notification-settings/wpcom-settings/index.jsx b/client/me/notification-settings/wpcom-settings/index.jsx index 36bb11c179b2b..a9bab50656d57 100644 --- a/client/me/notification-settings/wpcom-settings/index.jsx +++ b/client/me/notification-settings/wpcom-settings/index.jsx @@ -4,6 +4,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; +import { localize } from 'i18n-calypso'; /** * Internal dependencies @@ -55,11 +56,11 @@ const WPCOMNotifications = React.createClass( { const state = store.getStateFor( 'wpcom' ); if ( state.error ) { - this.props.errorNotice( this.translate( 'There was a problem saving your changes. Please, try again.' ) ); + this.props.errorNotice( this.props.translate( 'There was a problem saving your changes. Please, try again.' ) ); } if ( state.status === 'success' ) { - this.props.successNotice( this.translate( 'Settings saved successfully!' ) ); + this.props.successNotice( this.props.translate( 'Settings saved successfully!' ) ); } this.setState( state ); @@ -77,7 +78,7 @@ const WPCOMNotifications = React.createClass( { return (

- { this.translate( + { this.props.translate( 'We\'ll always send important emails regarding your account, security, ' + 'privacy, and purchase transactions, but you can get some helpful extras, too.' ) } @@ -86,39 +87,40 @@ const WPCOMNotifications = React.createClass( { - { this.translate( 'Email from WordPress.com' ) } + { this.props.translate( 'Email from WordPress.com' ) } { this.state.settings ? this.renderWpcomPreferences() : this.renderPlaceholder() } @@ -157,4 +159,4 @@ const WPCOMNotifications = React.createClass( { export default connect( null, dispatch => bindActionCreators( { successNotice, errorNotice }, dispatch ) -)( WPCOMNotifications ); +)( localize( WPCOMNotifications ) );