From ca4b71b6e2e112d45d896235c6ff461d70f47e86 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Tue, 14 Nov 2017 21:54:00 +0100 Subject: [PATCH 1/5] Update to use newer _t() --- .../structures/CompatibilityPage.js | 34 ++++++++----------- .../views/globals/PasswordNagBar.js | 8 ++--- .../views/settings/Notifications.js | 9 ++--- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/components/structures/CompatibilityPage.js b/src/components/structures/CompatibilityPage.js index 88b01cb2..ac5a2476 100644 --- a/src/components/structures/CompatibilityPage.js +++ b/src/components/structures/CompatibilityPage.js @@ -17,7 +17,7 @@ limitations under the License. 'use strict'; var React = require('react'); -import { _t, _tJsx } from 'matrix-react-sdk/lib/languageHandler'; +import { _t } from 'matrix-react-sdk/lib/languageHandler'; module.exports = React.createClass({ displayName: 'CompatibilityPage', @@ -40,30 +40,24 @@ module.exports = React.createClass({ return (
-

{ _tJsx("Sorry, your browser is not able to run Riot.", /(.*?)<\/b>/, (sub) => {sub}) }

+

{ _t("Sorry, your browser is not able to run Riot.", {}, { 'b': (sub) => {sub} }) }

{ _t("Riot uses many advanced browser features, some of which are not available or experimental in your current browser.") }

- { _tJsx('Please install Chrome or Firefox for the best experience.', - [ - /(.*?)<\/a>/, - /(.*?)<\/a>/, - ], - [ - (sub) => {sub}, - (sub) => {sub}, - ] + { _t('Please install Chrome or Firefox for the best experience.', + {}, + { + 'chromeLink': (sub) => {sub}, + 'firefoxLink': (sub) => {sub}, + }, )} - { _tJsx('Safari and Opera work too.', - [ - /(.*?)<\/a>/, - /(.*?)<\/a>/, - ], - [ - (sub) => {sub}, - (sub) => {sub}, - ] + { _t('< safariLink>Safari and Opera work too.', + {}, + { + 'safariLink': (sub) => {sub}, + 'operaLink': (sub) => {sub}, + }, )}

diff --git a/src/components/views/globals/PasswordNagBar.js b/src/components/views/globals/PasswordNagBar.js index bf71fa2c..a04d48e0 100644 --- a/src/components/views/globals/PasswordNagBar.js +++ b/src/components/views/globals/PasswordNagBar.js @@ -20,7 +20,7 @@ import React from 'react'; import sdk from 'matrix-react-sdk'; import Modal from 'matrix-react-sdk/lib/Modal'; import dis from 'matrix-react-sdk/lib/dispatcher'; -import { _t, _tJsx } from 'matrix-react-sdk/lib/languageHandler'; +import { _t } from 'matrix-react-sdk/lib/languageHandler'; export default React.createClass({ onUpdateClicked: function() { @@ -49,10 +49,10 @@ export default React.createClass({ alt="Warning" />

- { _tJsx( + { _t( "To return to your account in future you need to set a password", - /(.*?)<\/u>/, - (sub) => { return { sub }; }, + {}, + { 'u': (sub) => { sub } }, ) }