Skip to content

Commit 1dce9cd

Browse files
committed
Translate src/components/views/globals
directory and elements already done
1 parent 162f387 commit 1dce9cd

3 files changed

Lines changed: 36 additions & 8 deletions

File tree

‎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/i18n/strings/en_EN.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"<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.",
3+
"A new version of Riot is available.": "A new version of Riot is available.",
34
"Add an email address above to configure email notifications": "Add an email address above to configure email notifications",
45
"Advanced notification settings": "Advanced notification settings",
56
"All messages": "All messages",
@@ -125,11 +126,14 @@
125126
"Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s",
126127
"View Decrypted Source": "View Decrypted Source",
127128
"View Source": "View Source",
129+
"What's New": "What's New",
130+
"What's new?": "What's new?",
128131
"When I'm invited to a room": "When I'm invited to a room",
129132
"World readable": "World readable",
130133
"You cannot delete this image. (%(code)s)": "You cannot delete this image. (%(code)s)",
131134
"You cannot delete this message. (%(code)s)": "You cannot delete this message. (%(code)s)",
132135
"You are not receiving desktop notifications": "You are not receiving desktop notifications",
136+
"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!",
133137
"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",
134138
"Sunday": "Sunday",
135139
"Monday": "Monday",

0 commit comments

Comments
 (0)