Skip to content

Commit ca4b71b

Browse files
committed
Update to use newer _t()
1 parent 73e7581 commit ca4b71b

3 files changed

Lines changed: 23 additions & 28 deletions

File tree

src/components/structures/CompatibilityPage.js

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +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';
20+
import { _t } from 'matrix-react-sdk/lib/languageHandler';
2121

2222
module.exports = React.createClass({
2323
displayName: 'CompatibilityPage',
@@ -40,30 +40,24 @@ module.exports = React.createClass({
4040
return (
4141
<div className="mx_CompatibilityPage">
4242
<div className="mx_CompatibilityPage_box">
43-
<p>{ _tJsx("Sorry, your browser is <b>not</b> able to run Riot.", /<b>(.*?)<\/b>/, (sub) => <b>{sub}</b>) } </p>
43+
<p>{ _t("Sorry, your browser is <b>not</b> able to run Riot.", {}, { 'b': (sub) => <b>{sub}</b> }) } </p>
4444
<p>
4545
{ _t("Riot uses many advanced browser features, some of which are not available or experimental in your current browser.") }
4646
</p>
4747
<p>
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-
]
48+
{ _t('Please install <chromeLink>Chrome</chromeLink> or <firefoxLink>Firefox</firefoxLink> for the best experience.',
49+
{},
50+
{
51+
'chromeLink': (sub) => <a href="https://www.google.com/chrome">{sub}</a>,
52+
'firefoxLink': (sub) => <a href="https://getfirefox.com">{sub}</a>,
53+
},
5754
)}
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-
]
55+
{ _t('< safariLink>Safari</safariLink> and <operaLink>Opera</operaLink> work too.',
56+
{},
57+
{
58+
'safariLink': (sub) => <a href="http://apple.com/safari">{sub}</a>,
59+
'operaLink': (sub) => <a href="http://opera.com">{sub}</a>,
60+
},
6761
)}
6862
</p>
6963
<p>

src/components/views/globals/PasswordNagBar.js

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

2525
export default React.createClass({
2626
onUpdateClicked: function() {
@@ -49,10 +49,10 @@ export default React.createClass({
4949
alt="Warning"
5050
/>
5151
<div className="mx_MatrixToolbar_content">
52-
{ _tJsx(
52+
{ _t(
5353
"To return to your account in future you need to <u>set a password</u>",
54-
/<u>(.*?)<\/u>/,
55-
(sub) => { return <u>{ sub }</u>; },
54+
{},
55+
{ 'u': (sub) => <u>{ sub }</u> },
5656
) }
5757
</div>
5858
<button className="mx_MatrixToolbar_action">

src/components/views/settings/Notifications.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
import React from 'react';
1818
import Promise from 'bluebird';
1919
import sdk from 'matrix-react-sdk';
20-
import { _t, _tJsx } from 'matrix-react-sdk/lib/languageHandler';
20+
import { _t } from 'matrix-react-sdk/lib/languageHandler';
2121
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
2222
import UserSettingsStore from 'matrix-react-sdk/lib/UserSettingsStore';
2323
import Modal from 'matrix-react-sdk/lib/Modal';
@@ -542,10 +542,11 @@ module.exports = React.createClass({
542542
"vectorRuleId": "_keywords",
543543
"description" : (
544544
<span>
545-
{ _tJsx('Messages containing <span>keywords</span>',
546-
/<span>(.*?)<\/span>/,
547-
(sub) =>
545+
{ _t('Messages containing <span>keywords</span>',
546+
{},
547+
{ 'span': (sub) =>
548548
<span className="mx_UserNotifSettings_keywords" onClick={ self.onKeywordsClicked }>{sub}</span>
549+
},
549550
)}
550551
</span>
551552
),

0 commit comments

Comments
 (0)