From 0919b7ce3ae7f388b3310660d8dcc57b18c7e7ad Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Mon, 5 Jun 2017 16:13:44 +0100 Subject: [PATCH] i18n for SetPasswordDialog --- .../views/dialogs/SetPasswordDialog.js | 25 +++++++++---------- src/i18n/strings/en_EN.json | 8 +++++- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/components/views/dialogs/SetPasswordDialog.js b/src/components/views/dialogs/SetPasswordDialog.js index 7da7a55d50..76c3bb229e 100644 --- a/src/components/views/dialogs/SetPasswordDialog.js +++ b/src/components/views/dialogs/SetPasswordDialog.js @@ -14,11 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import q from 'q'; import React from 'react'; import sdk from 'matrix-react-sdk'; -import {MatrixClientPeg} from 'matrix-react-sdk'; -import classnames from 'classnames'; +import { _t } from 'matrix-react-sdk/lib/languageHandler'; + /** * Prompt the user to set a password @@ -51,9 +50,12 @@ export default React.createClass({ _onPasswordChangeError: function(err) { let errMsg = err.error || ""; if (err.httpStatus === 403) { - errMsg = "Failed to change password. Is your password correct?"; + errMsg = _t('Failed to change password. Is your password correct?'); } else if (err.httpStatus) { - errMsg += ` (HTTP status ${err.httpStatus})`; + errMsg += _t( + ' (HTTP status %(httpStatus))', + { httpStatus: err.httpStatus }, + ); } this.setState({ error: errMsg, @@ -63,18 +65,16 @@ export default React.createClass({ render: function() { const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); const ChangePassword = sdk.getComponent('views.settings.ChangePassword'); - const Spinner = sdk.getComponent('elements.Spinner'); if (this.state.success) { return (

- You can now return to your account after signing out, - and sign in on other devices. + { _t('You can now return to your account after signing out, and sign in on other devices.') }

@@ -82,7 +82,7 @@ export default React.createClass({ className="mx_Dialog_primary" autoFocus={true} onClick={this._onContinueClicked}> - Continue + { _t('Continue') }
@@ -92,12 +92,11 @@ export default React.createClass({ return (

- This will allow you to return to your account after signing out, - and sign in on other devices. + { _t('This will allow you to return to your account after signing out, and sign in on other devices.') }