Skip to content

Commit 7e21e00

Browse files
committed
Translate src/components/structures
1 parent 543f4ef commit 7e21e00

5 files changed

Lines changed: 39 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
@@ -93,7 +93,7 @@ module.exports = React.createClass({
9393
var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog");
9494
Modal.createDialog(NeedToRegisterDialog, {
9595
title: _t('Please Register'),
96-
description: _t('Guest users can\'t invite users. Please register to invite') + '.'
96+
description: _t('Guest users can\'t invite users. Please register to invite.')
9797
});
9898
return;
9999
}
@@ -218,7 +218,7 @@ module.exports = React.createClass({
218218
<TintableSvg src="img/icons-notifications.svg" width="25" height="25"/>
219219
{ notificationsHighlight }
220220
</AccessibleButton>
221-
<div className="mx_RightPanel_headerButton mx_RightPanel_collapsebutton" title="Hide panel" onClick={ this.onCollapseClick }>
221+
<div className="mx_RightPanel_headerButton mx_RightPanel_collapsebutton" title={ _t("Hide panel") } onClick={ this.onCollapseClick }>
222222
<TintableSvg src="img/minimise.svg" width="10" height="16"/>
223223
</div>
224224
</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: 7 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",
@@ -48,6 +49,7 @@
4849
" from room": " from room",
4950
"Guests can join": "Guests can join",
5051
"Guest users can't invite users. Please register to invite": "Guest users can't invite users. Please register to invite",
52+
"I understand the risks and wish to continue": "I understand the risks and wish to continue",
5153
"Invite to this room": "Invite to this room",
5254
"Keywords": "Keywords",
5355
"Leave": "Leave",
@@ -72,6 +74,7 @@
7274
"On": "On",
7375
"Operation failed": "Operation failed",
7476
"Permalink": "Permalink",
77+
"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.",
7578
"Please Register": "Please Register",
7679
"powered by Matrix": "powered by Matrix",
7780
"Quote": "Quote",
@@ -83,11 +86,13 @@
8386
"Remove from Directory": "Remove from Directory",
8487
"Resend": "Resend",
8588
"Riot does not know how to join a room on this network": "Riot does not know how to join a room on this network",
89+
"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.",
8690
"Room directory": "Room directory",
8791
"Room not found": "Room not found",
8892
"Search for a room": "Search for a room",
8993
"Settings": "Settings",
9094
"Source URL": "Source URL",
95+
"Sorry, your browser is <b>not</b> able to run Riot.": "Sorry, your browser is <b>not</b> able to run Riot.",
9196
"Start chat": "Start chat",
9297
"The Home Server may be too old to support third party networks": "The Home Server may be too old to support third party networks",
9398
"There are advanced notifications which are not shown here": "There are advanced notifications which are not shown here",
@@ -118,5 +123,6 @@
118123
"Saturday": "Saturday",
119124
"Today": "Today",
120125
"Yesterday": "Yesterday",
121-
"Welcome page": "Welcome page"
126+
"Welcome page": "Welcome page",
127+
"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!"
122128
}

0 commit comments

Comments
 (0)