Skip to content

Commit f4c7aaf

Browse files
authored
Merge pull request element-hq#4084 from vector-im/kegan/translation-monkey
Translate src/components/structures
2 parents 88edd16 + 1b4444c commit f4c7aaf

5 files changed

Lines changed: 41 additions & 18 deletions

File tree

‎src/components/structures/CompatibilityPage.js‎

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
'use strict';
1818

1919
var React = require('react');
20+
import { _t, _tJsx } from 'matrix-react-sdk/lib/languageHandler';
2021

2122
module.exports = React.createClass({
2223
displayName: 'CompatibilityPage',
@@ -39,23 +40,37 @@ module.exports = React.createClass({
3940
return (
4041
<div className="mx_CompatibilityPage">
4142
<div className="mx_CompatibilityPage_box">
42-
<p>Sorry, your browser is <b>not</b> able to run Riot.</p>
43+
<p>{ _tJsx("Sorry, your browser is <b>not</b> able to run Riot.", /<b>(.*?)<\/b>/, (sub) => <b>{sub}</b>) } </p>
4344
<p>
44-
Riot uses many advanced browser features, some of which are not
45-
available or experimental in your current browser.
45+
{ _t("Riot uses many advanced browser features, some of which are not available or experimental in your current browser.") }
4646
</p>
4747
<p>
48-
Please install <a href="https://www.google.com/chrome">Chrome</a> or <a href="https://getfirefox.com">Firefox</a> for
49-
the best experience. <a href="http://apple.com/safari">Safari</a> and <a href="http://opera.com">Opera</a> work too.
48+
{ _tJsx('Please install <a href="https://www.google.com/chrome">Chrome</a> or <a href="https://getfirefox.com">Firefox</a> for the best experience.',
49+
[
50+
/<a href="https:\/\/www.google.com\/chrome">(.*?)<\/a>/,
51+
/<a href="https:\/\/getfirefox.com">(.*?)<\/a>/,
52+
],
53+
[
54+
(sub) => <a href="https://www.google.com/chrome">{sub}</a>,
55+
(sub) => <a href="https://getfirefox.com">{sub}</a>,
56+
]
57+
)}
58+
{ _tJsx('<a href="http://apple.com/safari">Safari</a> and <a href="http://opera.com">Opera</a> work too.',
59+
[
60+
/<a href="http:\/\/apple\.com\/safari">(.*?)<\/a>/,
61+
/<a href="http:\/\/opera\.com">(.*?)<\/a>/,
62+
],
63+
[
64+
(sub) => <a href="http://apple.com/safari">{sub}</a>,
65+
(sub) => <a href="http://opera.com">{sub}</a>,
66+
]
67+
)}
5068
</p>
5169
<p>
52-
With your current browser, the look and feel of the application may
53-
be completely incorrect, and some or all features may not function.
54-
If you want to try it anyway you can continue, but you are on your own
55-
in terms of any issues you may encounter!
70+
{ _t("With your current browser, the look and feel of the application may be completely incorrect, and some or all features may not function. If you want to try it anyway you can continue, but you are on your own in terms of any issues you may encounter!") }
5671
</p>
5772
<button onClick={this.onAccept}>
58-
I understand the risks and wish to continue
73+
{ _t("I understand the risks and wish to continue") }
5974
</button>
6075
</div>
6176
</div>

‎src/components/structures/RightPanel.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ module.exports = React.createClass({
9696
var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog");
9797
Modal.createDialog(NeedToRegisterDialog, {
9898
title: _t('Please Register'),
99-
description: _t('Guest users can\'t invite users. Please register to invite') + '.'
99+
description: _t('Guest users can\'t invite users. Please register to invite.')
100100
});
101101
return;
102102
}
@@ -221,7 +221,7 @@ module.exports = React.createClass({
221221
<TintableSvg src="img/icons-notifications.svg" width="25" height="25"/>
222222
{ notificationsHighlight }
223223
</AccessibleButton>
224-
<div className="mx_RightPanel_headerButton mx_RightPanel_collapsebutton" title="Hide panel" onClick={ this.onCollapseClick }>
224+
<div className="mx_RightPanel_headerButton mx_RightPanel_collapsebutton" title={ _t("Hide panel") } onClick={ this.onCollapseClick }>
225225
<TintableSvg src="img/minimise.svg" width="10" height="16"/>
226226
</div>
227227
</div>;

‎src/components/structures/RoomDirectory.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ module.exports = React.createClass({
213213

214214
var Loader = sdk.getComponent("elements.Spinner");
215215
var modal = Modal.createDialog(Loader);
216-
var step = _t('remove %(name)s from the directory', {name: name}) + '.';
216+
var step = _t('remove %(name)s from the directory.', {name: name});
217217

218218
MatrixClientPeg.get().setRoomDirectoryVisibility(room.room_id, 'private').then(() => {
219219
if (!alias) return;
220-
step = _t('delete the alias') + '.';
220+
step = _t('delete the alias.');
221221
return MatrixClientPeg.get().deleteAlias(alias);
222222
}).done(() => {
223223
modal.close();
@@ -356,7 +356,7 @@ module.exports = React.createClass({
356356
var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog");
357357
Modal.createDialog(NeedToRegisterDialog, {
358358
title: _t('Failed to join the room'),
359-
description: _t('This room is inaccessible to guests. You may be able to join if you register') + '.'
359+
description: _t('This room is inaccessible to guests. You may be able to join if you register.')
360360
});
361361
return;
362362
}

‎src/components/structures/SearchBox.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ module.exports = React.createClass({
100100
if (this.props.collapsed) {
101101
toggleCollapse =
102102
<AccessibleButton className="mx_SearchBox_maximise" tabIndex={collapseTabIndex} onClick={ this.onToggleCollapse.bind(this, true) }>
103-
<TintableSvg src="img/maximise.svg" width="10" height="16" alt="Expand panel"/>
103+
<TintableSvg src="img/maximise.svg" width="10" height="16" alt={ _t("Expand panel") }/>
104104
</AccessibleButton>
105105
}
106106
else {
107107
toggleCollapse =
108108
<AccessibleButton className="mx_SearchBox_minimise" tabIndex={collapseTabIndex} onClick={ this.onToggleCollapse.bind(this, false) }>
109-
<TintableSvg src="img/minimise.svg" width="10" height="16" alt="Collapse panel"/>
109+
<TintableSvg src="img/minimise.svg" width="10" height="16" alt={ _t("Collapse panel") }/>
110110
</AccessibleButton>
111111
}
112112

‎src/i18n/strings/en_EN.json‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"<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.",
23
"Add an email address above to configure email notifications": "Add an email address above to configure email notifications",
34
"Advanced notification settings": "Advanced notification settings",
45
"All messages": "All messages",
@@ -9,6 +10,7 @@
910
"Cancel Sending": "Cancel Sending",
1011
"Can't update user notification settings": "Can't update user notification settings",
1112
"Close": "Close",
13+
"Collapse panel": "Collapse panel",
1214
"Create new room": "Create new room",
1315
"Couldn't find a matching Matrix room": "Couldn't find a matching Matrix room",
1416
"Custom Server Options": "Custom Server Options",
@@ -29,6 +31,7 @@
2931
"Error": "Error",
3032
"Error saving email notification preferences": "Error saving email notification preferences",
3133
"#example": "#example",
34+
"Expand panel": "Expand panel",
3235
"Failed to": "Failed to",
3336
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room",
3437
"Failed to change settings": "Failed to change settings",
@@ -48,6 +51,7 @@
4851
" from room": " from room",
4952
"Guests can join": "Guests can join",
5053
"Guest users can't invite users. Please register to invite": "Guest users can't invite users. Please register to invite",
54+
"I understand the risks and wish to continue": "I understand the risks and wish to continue",
5155
"Invite to this room": "Invite to this room",
5256
"Keywords": "Keywords",
5357
"Leave": "Leave",
@@ -72,6 +76,7 @@
7276
"On": "On",
7377
"Operation failed": "Operation failed",
7478
"Permalink": "Permalink",
79+
"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.",
7580
"Please Register": "Please Register",
7681
"powered by Matrix": "powered by Matrix",
7782
"Quote": "Quote",
@@ -83,11 +88,13 @@
8388
"Remove from Directory": "Remove from Directory",
8489
"Resend": "Resend",
8590
"Riot does not know how to join a room on this network": "Riot does not know how to join a room on this network",
91+
"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.",
8692
"Room directory": "Room directory",
8793
"Room not found": "Room not found",
8894
"Search for a room": "Search for a room",
8995
"Settings": "Settings",
9096
"Source URL": "Source URL",
97+
"Sorry, your browser is <b>not</b> able to run Riot.": "Sorry, your browser is <b>not</b> able to run Riot.",
9198
"Start chat": "Start chat",
9299
"The Home Server may be too old to support third party networks": "The Home Server may be too old to support third party networks",
93100
"There are advanced notifications which are not shown here": "There are advanced notifications which are not shown here",
@@ -118,5 +125,6 @@
118125
"Saturday": "Saturday",
119126
"Today": "Today",
120127
"Yesterday": "Yesterday",
121-
"Welcome page": "Welcome page"
128+
"Welcome page": "Welcome page",
129+
"With your current browser, the look and feel of the application may be completely incorrect, and some or all features may not function. If you want to try it anyway you can continue, but you are on your own in terms of any issues you may encounter!": "With your current browser, the look and feel of the application may be completely incorrect, and some or all features may not function. If you want to try it anyway you can continue, but you are on your own in terms of any issues you may encounter!"
122130
}

0 commit comments

Comments
 (0)