Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n for SetPasswordDialog #4198

Merged
merged 1 commit into from
Jun 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions src/components/views/dialogs/SetPasswordDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -63,26 +65,24 @@ 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 (
<BaseDialog className="mx_SetPasswordDialog"
onFinished={this.props.onFinished}
title="You have successfully set a password!"
title={ _t('You have successfully set a password!') }
>
<div className="mx_Dialog_content">
<p>
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.') }
</p>
</div>
<div className="mx_Dialog_buttons">
<button
className="mx_Dialog_primary"
autoFocus={true}
onClick={this._onContinueClicked}>
Continue
{ _t('Continue') }
</button>
</div>
</BaseDialog>
Expand All @@ -92,12 +92,11 @@ export default React.createClass({
return (
<BaseDialog className="mx_SetPasswordDialog"
onFinished={this.props.onFinished}
title="Please set a password!"
title={ _t('Please set a password!') }
>
<div className="mx_Dialog_content">
<p>
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.') }
</p>
<ChangePassword
className="mx_SetPasswordDialog_change_password"
Expand Down
8 changes: 7 additions & 1 deletion src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,11 @@
"Dev chat for the Riot/Web dev team": "Dev chat for the Riot/Web dev team",
"Dev chat for the Dendrite dev team": "Dev chat for the Dendrite dev team",
"Co-ordination for Riot/Web translators": "Co-ordination for Riot/Web translators",
"Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!": "Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!"
"Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!": "Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!",
"Failed to change password. Is your password correct?": "Failed to change password. Is your password correct?",
"You have successfully set a password!": "You have successfully set a password!",
"You can now return to your account after signing out, and sign in on other devices.": "You can now return to your account after signing out, and sign in on other devices.",
"Continue": "Continue",
"Please set a password!": "Please set a password!",
"This will allow you to return to your account after signing out, and sign in on other devices.": "This will allow you to return to your account after signing out, and sign in on other devices."
}