Skip to content

Commit 162f387

Browse files
committed
Translate src/components/context_menus|dialogs
1 parent 020d496 commit 162f387

4 files changed

Lines changed: 38 additions & 19 deletions

File tree

‎src/components/views/context_menus/MessageContextMenu.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ module.exports = React.createClass({
182182
if (content.msgtype && content.msgtype !== 'm.bad.encrypted' && content.hasOwnProperty('body')) {
183183
forwardButton = (
184184
<div className="mx_MessageContextMenu_field" onClick={this.onForwardClick}>
185-
Forward Message
185+
{ _t('Forward Message') }
186186
</div>
187187
);
188188
}

‎src/components/views/dialogs/BugReportDialog.js‎

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
import React from 'react';
1818
import sdk from 'matrix-react-sdk';
1919
import SdkConfig from 'matrix-react-sdk/lib/SdkConfig';
20+
import { _t } from 'matrix-react-sdk/lib/languageHandler';
2021

2122
export default class BugReportDialog extends React.Component {
2223
constructor(props, context) {
@@ -49,12 +50,12 @@ export default class BugReportDialog extends React.Component {
4950
const userText = this.state.text;
5051
if (!sendLogs && userText.trim().length === 0) {
5152
this.setState({
52-
err: "Please describe the bug and/or send logs.",
53+
err: _t("Please describe the bug and/or send logs."),
5354
});
5455
return;
5556
}
5657
this.setState({ busy: true, progress: null, err: null });
57-
this._sendProgressCallback("Loading bug report module");
58+
this._sendProgressCallback(_t("Loading bug report module"));
5859

5960
require(['../../../vector/submit-rageshake'], (s) => {
6061
s(SdkConfig.get().bug_report_endpoint_url, {
@@ -69,8 +70,9 @@ export default class BugReportDialog extends React.Component {
6970
}, (err) => {
7071
if (!this._unmounted) {
7172
this.setState({
72-
busy: false, progress: null,
73-
err: `Failed to send report: ${err.message}`,
73+
busy: false,
74+
progress: null,
75+
err: _t("Failed to send report: ") + `${err.message}`,
7476
});
7577
}
7678
});
@@ -105,7 +107,7 @@ export default class BugReportDialog extends React.Component {
105107
let cancelButton = null;
106108
if (!this.state.busy) {
107109
cancelButton = <button onClick={this._onCancel}>
108-
Cancel
110+
{ _t("Cancel") }
109111
</button>;
110112
}
111113

@@ -122,25 +124,27 @@ export default class BugReportDialog extends React.Component {
122124
return (
123125
<div className="mx_BugReportDialog">
124126
<div className="mx_Dialog_title">
125-
Report a bug
127+
{ _t("Report a bug") }
126128
</div>
127129
<div className="mx_Dialog_content">
128-
<p>Please describe the bug. What did you do?
129-
What did you expect to happen?
130-
What actually happened?</p>
130+
<p>
131+
{ _t("Please describe the bug. What did you do? What did you expect to happen? What actually happened?") }
132+
</p>
131133
<textarea
132134
className="mx_BugReportDialog_input"
133135
rows={5}
134136
onChange={this._onTextChange}
135137
value={this.state.text}
136-
placeholder="Describe your problem here."
138+
placeholder={_t("Describe your problem here.")}
137139
/>
138-
<p>In order to diagnose problems, logs from this client will be sent with
139-
this bug report.
140-
If you would prefer to only send the text above, please untick:</p>
140+
<p>
141+
{ _t("In order to diagnose problems, logs from this client will be sent with this bug report. If you would prefer to only send the text above, please untick:") }
142+
</p>
141143
<input type="checkbox" checked={this.state.sendLogs}
142144
onChange={this._onSendLogsChange} id="mx_BugReportDialog_logs"/>
143-
<label htmlFor="mx_BugReportDialog_logs">Send logs</label>
145+
<label htmlFor="mx_BugReportDialog_logs">
146+
{ _t("Send logs") }
147+
</label>
144148
{progress}
145149
{error}
146150
</div>
@@ -151,7 +155,7 @@ export default class BugReportDialog extends React.Component {
151155
autoFocus={true}
152156
disabled={this.state.busy}
153157
>
154-
Send
158+
{ _t("Send") }
155159
</button>
156160

157161
{cancelButton}

‎src/components/views/dialogs/ChangelogDialog.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import React from 'react';
1818
import sdk from 'matrix-react-sdk';
1919
import request from 'browser-request';
20+
import { _t } from 'matrix-react-sdk/lib/languageHandler';
2021

2122
const REPOS = ['vector-im/vector-web', 'matrix-org/matrix-react-sdk', 'matrix-org/matrix-js-sdk'];
2223

@@ -70,16 +71,16 @@ export default class ChangelogDialog extends React.Component {
7071

7172
const content = (
7273
<div className="mx_ChangelogDialog_content">
73-
{this.props.version == null || this.props.newVersion == null ? <h2>Unavailable</h2> : logs}
74+
{this.props.version == null || this.props.newVersion == null ? <h2>{_t("Unavailable")}</h2> : logs}
7475
</div>
7576
);
7677

7778

7879
return (
7980
<QuestionDialog
80-
title="Changelog"
81+
title={_t("Changelog")}
8182
description={content}
82-
button="Update"
83+
button={_t("Update")}
8384
onFinished={this.props.onFinished}
8485
/>
8586
)

‎src/i18n/strings/en_EN.json‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
"All notifications are currently disabled for all targets.": "All notifications are currently disabled for all targets.",
88
"An error occurred whilst saving your email notification preferences.": "An error occurred whilst saving your email notification preferences.",
99
"Call invitation": "Call invitation",
10+
"Cancel": "Cancel",
1011
"Cancel Sending": "Cancel Sending",
1112
"Can't update user notification settings": "Can't update user notification settings",
13+
"Changelog": "Changelog",
1214
"Close": "Close",
1315
"Collapse panel": "Collapse panel",
1416
"Create new room": "Create new room",
@@ -17,6 +19,7 @@
1719
"customServer_text": "You can use the custom server options to sign into other Matrix servers by specifying a different Home server URL.<br/>This allows you to use Riot with an existing Matrix account on a different home server.<br/><br/>You can also set a custom identity server but you won't be able to invite users by email address, or be invited by email address yourself.",
1820
"delete the alias": "delete the alias",
1921
"Delete the room alias %(alias)s and remove %(name)s from the directory?": "Delete the room alias %(alias)s and remove %(name)s from the directory?",
22+
"Describe your problem here.": "Describe your problem here.",
2023
"Direct Chat": "Direct Chat",
2124
"Directory": "Directory",
2225
"Dismiss": "Dismiss",
@@ -41,20 +44,24 @@
4144
"Failed to get public room list": "Failed to get public room list",
4245
"Failed to join the room": "Failed to join the room",
4346
"Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",
47+
"Failed to send report: ": "Failed to send report: ",
4448
"Failed to set direct chat tag": "Failed to set direct chat tag",
4549
"Failed to set Direct Message status of room": "Failed to set Direct Message status of room",
4650
"Favourite": "Favourite",
4751
"Fetching third party location failed": "Fetching third party location failed",
4852
"Files": "Files",
4953
"Filter room names": "Filter room names",
5054
"Forget": "Forget",
55+
"Forward Message": "Forward Message",
5156
" from room": " from room",
5257
"Guests can join": "Guests can join",
5358
"Guest users can't invite users. Please register to invite": "Guest users can't invite users. Please register to invite",
5459
"I understand the risks and wish to continue": "I understand the risks and wish to continue",
60+
"In order to diagnose problems, logs from this client will be sent with this bug report. If you would prefer to only send the text above, please untick:": "In order to diagnose problems, logs from this client will be sent with this bug report. If you would prefer to only send the text above, please untick:",
5561
"Invite to this room": "Invite to this room",
5662
"Keywords": "Keywords",
5763
"Leave": "Leave",
64+
"Loading bug report module": "Loading bug report module",
5865
"Low Priority": "Low Priority",
5966
"Members": "Members",
6067
"Mentions only": "Mentions only",
@@ -77,6 +84,8 @@
7784
"On": "On",
7885
"Operation failed": "Operation failed",
7986
"Permalink": "Permalink",
87+
"Please describe the bug. What did you do? What did you expect to happen? What actually happened?": "Please describe the bug. What did you do? What did you expect to happen? What actually happened?",
88+
"Please describe the bug and/or send logs.": "Please describe the bug and/or send logs.",
8089
"Please install <a href=\"https://www.google.com/chrome\">Chrome</a> or <a href=\"https://getfirefox.com\">Firefox</a> for the best experience.": "Please install <a href=\"https://www.google.com/chrome\">Chrome</a> or <a href=\"https://getfirefox.com\">Firefox</a> for the best experience.",
8190
"Please Register": "Please Register",
8291
"powered by Matrix": "powered by Matrix",
@@ -87,12 +96,15 @@
8796
"Remove": "Remove",
8897
"remove %(name)s from the directory": "remove %(name)s from the directory",
8998
"Remove from Directory": "Remove from Directory",
99+
"Report a bug": "Report a bug",
90100
"Resend": "Resend",
91101
"Riot does not know how to join a room on this network": "Riot does not know how to join a room on this network",
92102
"Riot uses many advanced browser features, some of which are not available or experimental in your current browser.": "Riot uses many advanced browser features, some of which are not available or experimental in your current browser.",
93103
"Room directory": "Room directory",
94104
"Room not found": "Room not found",
95105
"Search for a room": "Search for a room",
106+
"Send": "Send",
107+
"Send logs": "Send logs",
96108
"Settings": "Settings",
97109
"Source URL": "Source URL",
98110
"Sorry, your browser is <b>not</b> able to run Riot.": "Sorry, your browser is <b>not</b> able to run Riot.",
@@ -105,9 +117,11 @@
105117
"Unable to fetch notification target list": "Unable to fetch notification target list",
106118
"Unable to join network": "Unable to join network",
107119
"Unable to look up room ID from server": "Unable to look up room ID from server",
120+
"Unavailable": "Unavailable",
108121
"Unhide Preview": "Unhide Preview",
109122
"unknown error code": "unknown error code",
110123
"Unnamed room": "Unnamed room",
124+
"Update": "Update",
111125
"Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s",
112126
"View Decrypted Source": "View Decrypted Source",
113127
"View Source": "View Source",

0 commit comments

Comments
 (0)