diff --git a/src/components/views/dialogs/SetMxIdDialog.js b/src/components/views/dialogs/SetMxIdDialog.js index efca192ec1..78576eb1e4 100644 --- a/src/components/views/dialogs/SetMxIdDialog.js +++ b/src/components/views/dialogs/SetMxIdDialog.js @@ -21,6 +21,7 @@ import sdk from '../../../index'; import MatrixClientPeg from '../../../MatrixClientPeg'; import classnames from 'classnames'; import KeyCode from '../../../KeyCode'; +import { _t, _tJsx } from '../../../languageHandler'; // The amount of time to wait for further changes to the input username before // sending a request to the server @@ -120,10 +121,13 @@ export default React.createClass({ console.error('Error whilst checking username availability: ', err); switch (err.errcode) { case "M_USER_IN_USE": - newState.usernameError = 'Username not available'; + newState.usernameError = _t('Username not available'); break; case "M_INVALID_USERNAME": - newState.usernameError = 'Username invalid: ' + err.message; + newState.usernameError = _t( + 'Username invalid: %(errMessage)', + { errMessage: err.message}, + ); break; case "M_UNRECOGNIZED": // This homeserver doesn't support username checking, assume it's @@ -131,10 +135,13 @@ export default React.createClass({ newState.usernameError = ''; break; case undefined: - newState.usernameError = 'Something went wrong!'; + newState.usernameError = _t('Something went wrong!'); break; default: - newState.usernameError = 'An error occurred: ' + err.message; + newState.usernameError = _t( + 'An error occurred: %(errMessage)', + { errMessage: err.message }, + ); break; } this.setState(newState); @@ -218,7 +225,7 @@ export default React.createClass({ "success": usernameAvailable, }); usernameIndicator =
- This will be your account name on - the {this.props.homeserverUrl} homeserver, - or you can pick a - - different server - . + { _tJsx( + 'This will be your account name on the ' + + 'homeserver, or you can pick a different server.', + [ + /<\/span>/, + /(.*?)<\/a>/, + ], + [ + (sub) => {this.props.homeserverUrl}, + (sub) => {sub}, + ], + )}
- If you already have a Matrix account you can log in instead. + { _tJsx( + 'If you already have a Matrix account you can log in instead.', + /(.*?)<\/a>/, + [(sub) => {sub}], + )}
{ auth } { authErrorIndicator } @@ -266,7 +283,7 @@ export default React.createClass({