From 162f3872e5d2182b30346e6f2903b30691d40cf6 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 31 May 2017 15:40:49 +0100 Subject: [PATCH] Translate src/components/context_menus|dialogs --- .../views/context_menus/MessageContextMenu.js | 2 +- .../views/dialogs/BugReportDialog.js | 34 +++++++++++-------- .../views/dialogs/ChangelogDialog.js | 7 ++-- src/i18n/strings/en_EN.json | 14 ++++++++ 4 files changed, 38 insertions(+), 19 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 5445fd4f..e3f4d140 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -182,7 +182,7 @@ module.exports = React.createClass({ if (content.msgtype && content.msgtype !== 'm.bad.encrypted' && content.hasOwnProperty('body')) { forwardButton = (
- Forward Message + { _t('Forward Message') }
); } diff --git a/src/components/views/dialogs/BugReportDialog.js b/src/components/views/dialogs/BugReportDialog.js index 7a65ac58..0db425e3 100644 --- a/src/components/views/dialogs/BugReportDialog.js +++ b/src/components/views/dialogs/BugReportDialog.js @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import sdk from 'matrix-react-sdk'; import SdkConfig from 'matrix-react-sdk/lib/SdkConfig'; +import { _t } from 'matrix-react-sdk/lib/languageHandler'; export default class BugReportDialog extends React.Component { constructor(props, context) { @@ -49,12 +50,12 @@ export default class BugReportDialog extends React.Component { const userText = this.state.text; if (!sendLogs && userText.trim().length === 0) { this.setState({ - err: "Please describe the bug and/or send logs.", + err: _t("Please describe the bug and/or send logs."), }); return; } this.setState({ busy: true, progress: null, err: null }); - this._sendProgressCallback("Loading bug report module"); + this._sendProgressCallback(_t("Loading bug report module")); require(['../../../vector/submit-rageshake'], (s) => { s(SdkConfig.get().bug_report_endpoint_url, { @@ -69,8 +70,9 @@ export default class BugReportDialog extends React.Component { }, (err) => { if (!this._unmounted) { this.setState({ - busy: false, progress: null, - err: `Failed to send report: ${err.message}`, + busy: false, + progress: null, + err: _t("Failed to send report: ") + `${err.message}`, }); } }); @@ -105,7 +107,7 @@ export default class BugReportDialog extends React.Component { let cancelButton = null; if (!this.state.busy) { cancelButton = ; } @@ -122,25 +124,27 @@ export default class BugReportDialog extends React.Component { return (
- Report a bug + { _t("Report a bug") }
-

Please describe the bug. What did you do? - What did you expect to happen? - What actually happened?

+

+ { _t("Please describe the bug. What did you do? What did you expect to happen? What actually happened?") } +