diff --git a/client/me/constants.js b/client/me/constants.js new file mode 100644 index 0000000000000..150d4fcdee99e --- /dev/null +++ b/client/me/constants.js @@ -0,0 +1,19 @@ +/** + * Internal dependencies + */ +import i18n from 'lib/mixins/i18n'; + +export default { + sixDigit2faPlaceholder: i18n.translate( 'e.g. 123456', { + context: '6 digit two factor code placeholder.', + textOnly: true + } ), + sevenDigit2faPlaceholder: i18n.translate( 'e.g. 1234567', { + context: '7 digit two factor code placeholder.', + textOnly: true + } ), + eightDigitBackupCodePlaceholder: i18n.translate( 'e.g. 12345678', { + context: '8 digit two factor backup code placeholder.', + textOnly: true + } ) +}; diff --git a/client/me/reauth-required/index.jsx b/client/me/reauth-required/index.jsx index e1fa506290eae..20d6866a85033 100644 --- a/client/me/reauth-required/index.jsx +++ b/client/me/reauth-required/index.jsx @@ -18,7 +18,8 @@ var Dialog = require( 'components/dialog' ), observe = require( 'lib/mixins/data-observe' ), Notice = require( 'components/notice' ), eventRecorder = require( 'me/event-recorder' ), - userUtilities = require( 'lib/user/utils' ); + userUtilities = require( 'lib/user/utils' ), + constants = require( 'me/constants' ); module.exports = React.createClass( { @@ -152,17 +153,9 @@ module.exports = React.createClass( { }, render: function() { - var codePlaceholder = this.translate( 'e.g. 123456', { - context: '6 digit two factor code placeholder.', - textOnly: true - } ); - - if ( this.props.twoStepAuthorization.isTwoStepSMSEnabled() ) { - codePlaceholder = this.translate( 'e.g. 1234567', { - context: '7 digit two factor code placeholder.', - textOnly: true - } ); - } + var codePlaceholder = this.props.twoStepAuthorization.isTwoStepSMSEnabled() + ? constants.sevenDigit2faPlaceholder + : constants.sixDigit2faPlaceholder; return ( { this.translate( 'Type a Backup Code' ) } - { this.translate( 'Verification Code' ) } - { this.renderInputHelp() } -