Skip to content

Commit 6f9d94f

Browse files
authored
Merge pull request element-hq#4122 from vector-im/kegan/translation-macaque
Finish translations for vector-im/riot-web
2 parents bac5ae8 + aa5587b commit 6f9d94f

8 files changed

Lines changed: 85 additions & 32 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/components/views/globals/GuestWarningBar.js‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ limitations under the License.
1515
*/
1616

1717
var React = require('react');
18-
var dis = require('matrix-react-sdk/lib/dispatcher')
18+
var dis = require('matrix-react-sdk/lib/dispatcher');
19+
import { _tJsx } from 'matrix-react-sdk/lib/languageHandler';
1920

2021
module.exports = React.createClass({
2122
displayName: 'GuestWarningBar',
@@ -34,7 +35,17 @@ module.exports = React.createClass({
3435
<div className="mx_GuestWarningBar">
3536
<img className="mx_GuestWarningBar_warning" src="img/warning.svg" width="24" height="23" alt="/!\"/>
3637
<div>
37-
You are Rioting as a guest. <a onClick={this.onRegisterClicked}>Register</a> or <a onClick={this.onLoginClicked}>sign in</a> to access more rooms and features.
38+
{ _tJsx(
39+
"You are Rioting as a guest. <a>Register</a> or <a>sign in</a> to access more rooms and features!",
40+
[
41+
/<a>(.*?)<\/a>/,
42+
/<a>(.*?)<\/a>/
43+
],
44+
[
45+
(sub) => <a onClick={this.onRegisterClicked}>{sub}</a>,
46+
(sub) => <a onClick={this.onLoginClicked}>{sub}</a>
47+
]
48+
) }
3849
</div>
3950
</div>
4051
);

‎src/components/views/globals/NewVersionBar.js‎

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import React from 'react';
2020
import sdk from 'matrix-react-sdk';
2121
import Modal from 'matrix-react-sdk/lib/Modal';
2222
import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg';
23+
import { _t } from 'matrix-react-sdk/lib/languageHandler';
2324

2425
/**
2526
* Check a version string is compatible with the Changelog
@@ -40,9 +41,9 @@ export default React.createClass({
4041
displayReleaseNotes: function(releaseNotes) {
4142
const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog');
4243
Modal.createDialog(QuestionDialog, {
43-
title: "What's New",
44+
title: _t("What's New"),
4445
description: <pre className="changelog_text">{releaseNotes}</pre>,
45-
button: "Update",
46+
button: _t("Update"),
4647
onFinished: (update) => {
4748
if(update && PlatformPeg.get()) {
4849
PlatformPeg.get().installUpdate();
@@ -75,17 +76,29 @@ export default React.createClass({
7576
// automatically tells you what's changed (provided the versions
7677
// are in the right format)
7778
if (this.props.releaseNotes) {
78-
action_button = <button className="mx_MatrixToolbar_action" onClick={this.displayReleaseNotes}>What's new?</button>;
79+
action_button = (
80+
<button className="mx_MatrixToolbar_action" onClick={this.displayReleaseNotes}>
81+
{ _t("What's new?") }
82+
</button>
83+
);
7984
} else if (checkVersion(this.props.version) && checkVersion(this.props.newVersion)) {
80-
action_button = <button className="mx_MatrixToolbar_action" onClick={this.displayChangelog}>What's new?</button>;
85+
action_button = (
86+
<button className="mx_MatrixToolbar_action" onClick={this.displayChangelog}>
87+
{ _t("What's new?") }
88+
</button>
89+
);
8190
} else if (PlatformPeg.get()) {
82-
action_button = <button className="mx_MatrixToolbar_action" onClick={this.onUpdateClicked}>Update</button>;
91+
action_button = (
92+
<button className="mx_MatrixToolbar_action" onClick={this.onUpdateClicked}>
93+
{ _t("Update") }
94+
</button>
95+
);
8396
}
8497
return (
8598
<div className="mx_MatrixToolbar">
8699
<img className="mx_MatrixToolbar_warning" src="img/warning.svg" width="24" height="23" alt="/!\"/>
87100
<div className="mx_MatrixToolbar_content">
88-
A new version of Riot is available.
101+
{_t("A new version of Riot is available.")}
89102
</div>
90103
{action_button}
91104
</div>

‎src/components/views/login/VectorCustomServerDialog.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ limitations under the License.
1515
*/
1616

1717
var React = require("react");
18+
var sanitizeHtml = require("sanitize-html");
1819
import { _t } from 'matrix-react-sdk/lib/languageHandler';
1920

2021
module.exports = React.createClass({
@@ -30,7 +31,7 @@ module.exports = React.createClass({
3031
{ _t('Custom Server Options') }
3132
</div>
3233
<div className="mx_Dialog_content">
33-
<span dangerouslySetInnerHTML={{__html: _t('customServer_text')}} />
34+
<span dangerouslySetInnerHTML={{__html: sanitizeHtml(_t('customServer_text'))}} />
3435
</div>
3536
<div className="mx_Dialog_buttons">
3637
<button onClick={this.props.onFinished} autoFocus={true}>

‎src/components/views/rooms/SearchBar.js‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
2121
var sdk = require('matrix-react-sdk');
2222
var classNames = require('classnames');
2323
var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton');
24+
import { _t } from "matrix-react-sdk/lib/languageHandler";
2425

2526
module.exports = React.createClass({
2627
displayName: 'SearchBar',
@@ -59,10 +60,10 @@ module.exports = React.createClass({
5960

6061
return (
6162
<div className="mx_SearchBar">
62-
<input ref="search_term" className="mx_SearchBar_input" type="text" autoFocus={true} placeholder="Search..." onKeyDown={this.onSearchChange}/>
63-
<AccessibleButton className={ searchButtonClasses } onClick={this.onSearch}><img src="img/search-button.svg" width="37" height="37" alt="Search"/></AccessibleButton>
64-
<AccessibleButton className={ thisRoomClasses } onClick={this.onThisRoomClick}>This Room</AccessibleButton>
65-
<AccessibleButton className={ allRoomsClasses } onClick={this.onAllRoomsClick}>All Rooms</AccessibleButton>
63+
<input ref="search_term" className="mx_SearchBar_input" type="text" autoFocus={true} placeholder={_t("Search…")} onKeyDown={this.onSearchChange}/>
64+
<AccessibleButton className={ searchButtonClasses } onClick={this.onSearch}><img src="img/search-button.svg" width="37" height="37" alt={_t("Search")}/></AccessibleButton>
65+
<AccessibleButton className={ thisRoomClasses } onClick={this.onThisRoomClick}>{_t("This Room")}</AccessibleButton>
66+
<AccessibleButton className={ allRoomsClasses } onClick={this.onAllRoomsClick}>{_t("All Rooms")}</AccessibleButton>
6667
<AccessibleButton className="mx_SearchBar_cancel" onClick={this.props.onCancelClick}><img src="img/cancel.svg" width="18" height="18" /></AccessibleButton>
6768
</div>
6869
);

‎src/i18n/strings/en_EN.json‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
{
22
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s via %(browserName)s on %(osName)s",
33
"<a href=\"http://apple.com/safari\">Safari</a> and <a href=\"http://opera.com\">Opera</a> work too.": "<a href=\"http://apple.com/safari\">Safari</a> and <a href=\"http://opera.com\">Opera</a> work too.",
4+
"A new version of Riot is available.": "A new version of Riot is available.",
45
"Add an email address above to configure email notifications": "Add an email address above to configure email notifications",
56
"Advanced notification settings": "Advanced notification settings",
67
"All messages": "All messages",
78
"All messages (loud)": "All messages (loud)",
9+
"All Rooms": "All Rooms",
810
"All notifications are currently disabled for all targets.": "All notifications are currently disabled for all targets.",
911
"An error occurred whilst saving your email notification preferences.": "An error occurred whilst saving your email notification preferences.",
1012
"Call invitation": "Call invitation",
13+
"Cancel": "Cancel",
1114
"Cancel Sending": "Cancel Sending",
1215
"Can't update user notification settings": "Can't update user notification settings",
16+
"Changelog": "Changelog",
1317
"Close": "Close",
1418
"Collapse panel": "Collapse panel",
1519
"Collecting app version information": "Collecting app version information",
@@ -20,6 +24,7 @@
2024
"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.",
2125
"delete the alias": "delete the alias",
2226
"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?",
27+
"Describe your problem here.": "Describe your problem here.",
2328
"Direct Chat": "Direct Chat",
2429
"Directory": "Directory",
2530
"Dismiss": "Dismiss",
@@ -44,20 +49,24 @@
4449
"Failed to get public room list": "Failed to get public room list",
4550
"Failed to join the room": "Failed to join the room",
4651
"Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",
52+
"Failed to send report: ": "Failed to send report: ",
4753
"Failed to set direct chat tag": "Failed to set direct chat tag",
4854
"Failed to set Direct Message status of room": "Failed to set Direct Message status of room",
4955
"Favourite": "Favourite",
5056
"Fetching third party location failed": "Fetching third party location failed",
5157
"Files": "Files",
5258
"Filter room names": "Filter room names",
5359
"Forget": "Forget",
60+
"Forward Message": "Forward Message",
5461
" from room": " from room",
5562
"Guests can join": "Guests can join",
5663
"Guest users can't invite users. Please register to invite": "Guest users can't invite users. Please register to invite",
5764
"I understand the risks and wish to continue": "I understand the risks and wish to continue",
65+
"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:",
5866
"Invite to this room": "Invite to this room",
5967
"Keywords": "Keywords",
6068
"Leave": "Leave",
69+
"Loading bug report module": "Loading bug report module",
6170
"Low Priority": "Low Priority",
6271
"Members": "Members",
6372
"Mentions only": "Mentions only",
@@ -80,6 +89,8 @@
8089
"On": "On",
8190
"Operation failed": "Operation failed",
8291
"Permalink": "Permalink",
92+
"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?",
93+
"Please describe the bug and/or send logs.": "Please describe the bug and/or send logs.",
8394
"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.",
8495
"Please Register": "Please Register",
8596
"powered by Matrix": "powered by Matrix",
@@ -90,40 +101,51 @@
90101
"Remove": "Remove",
91102
"remove %(name)s from the directory": "remove %(name)s from the directory",
92103
"Remove from Directory": "Remove from Directory",
104+
"Report a bug": "Report a bug",
93105
"Resend": "Resend",
94106
"Riot Desktop on %(platformName)": "Riot Desktop on %(platformName)",
95107
"Riot does not know how to join a room on this network": "Riot does not know how to join a room on this network",
96108
"Riot is not supported on mobile web. Install the app?": "Riot is not supported on mobile web. Install the app?",
97109
"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.",
98110
"Room directory": "Room directory",
99111
"Room not found": "Room not found",
112+
"Search": "Search",
113+
"Search…": "Search…",
100114
"Search for a room": "Search for a room",
115+
"Send": "Send",
116+
"Send logs": "Send logs",
101117
"Settings": "Settings",
102118
"Source URL": "Source URL",
103119
"Sorry, your browser is <b>not</b> able to run Riot.": "Sorry, your browser is <b>not</b> able to run Riot.",
104120
"Start chat": "Start chat",
105121
"The Home Server may be too old to support third party networks": "The Home Server may be too old to support third party networks",
106122
"There are advanced notifications which are not shown here": "There are advanced notifications which are not shown here",
107123
"The server may be unavailable or overloaded": "The server may be unavailable or overloaded",
124+
"This Room": "This Room",
108125
"This room is inaccessible to guests. You may be able to join if you register": "This room is inaccessible to guests. You may be able to join if you register",
109126
" to room": " to room",
110127
"Unable to fetch notification target list": "Unable to fetch notification target list",
111128
"Unable to join network": "Unable to join network",
112129
"Unable to look up room ID from server": "Unable to look up room ID from server",
130+
"Unavailable": "Unavailable",
113131
"Unhide Preview": "Unhide Preview",
114132
"Unknown device": "Unknown device",
115133
"unknown error code": "unknown error code",
116134
"Unnamed room": "Unnamed room",
135+
"Update": "Update",
117136
"Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s",
118137
"Uploading report": "Uploading report",
119138
"View Decrypted Source": "View Decrypted Source",
120139
"View Source": "View Source",
140+
"What's New": "What's New",
141+
"What's new?": "What's new?",
121142
"Waiting for response from server": "Waiting for response from server",
122143
"When I'm invited to a room": "When I'm invited to a room",
123144
"World readable": "World readable",
124145
"You cannot delete this image. (%(code)s)": "You cannot delete this image. (%(code)s)",
125146
"You cannot delete this message. (%(code)s)": "You cannot delete this message. (%(code)s)",
126147
"You are not receiving desktop notifications": "You are not receiving desktop notifications",
148+
"You are Rioting as a guest. <a>Register</a> or <a>sign in</a> to access more rooms and features!": "You are Rioting as a guest. <a>Register</a> or <a>sign in</a> to access more rooms and features!",
127149
"You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply": "You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply",
128150
"Sunday": "Sunday",
129151
"Monday": "Monday",

0 commit comments

Comments
 (0)