From d2e766e4f0d2db85d4f227ca1ace35cc96929e4e Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 2 Jun 2017 10:18:31 +0100 Subject: [PATCH] First round --- src/components/views/elements/PowerSelector.js | 3 ++- .../login/InteractiveAuthEntryComponents.js | 6 +++--- .../views/room_settings/AliasSettings.js | 2 +- .../views/room_settings/UrlPreviewSettings.js | 16 ++++++++++++++-- src/components/views/rooms/MemberDeviceInfo.js | 3 ++- src/components/views/rooms/RoomHeader.js | 6 +++++- src/components/views/rooms/RoomSettings.js | 6 +++--- src/components/views/rooms/RoomTopicEditor.js | 3 ++- src/i18n/strings/en_EN.json | 11 +++++++++++ 9 files changed, 43 insertions(+), 13 deletions(-) diff --git a/src/components/views/elements/PowerSelector.js b/src/components/views/elements/PowerSelector.js index a4a117b9cb..efeb81fe2d 100644 --- a/src/components/views/elements/PowerSelector.js +++ b/src/components/views/elements/PowerSelector.js @@ -18,6 +18,7 @@ limitations under the License. import React from 'react'; import * as Roles from '../../../Roles'; +import { _t } from '../../../languageHandler'; var LEVEL_ROLE_MAP = {}; var reverseRoles = {}; @@ -116,7 +117,7 @@ module.exports = React.createClass({ text: Roles.textualPowerLevel(level, 0), } }); - options.push({ value: "Custom", text: "Custom level" }); + options.push({ value: "Custom", text: _t("Custom level") }); options = options.map((op) => { return ; }); diff --git a/src/components/views/login/InteractiveAuthEntryComponents.js b/src/components/views/login/InteractiveAuthEntryComponents.js index 8c0be10ba9..d570847c21 100644 --- a/src/components/views/login/InteractiveAuthEntryComponents.js +++ b/src/components/views/login/InteractiveAuthEntryComponents.js @@ -129,8 +129,8 @@ export const PasswordAuthEntry = React.createClass({ return (
-

To continue, please enter your password.

-

Password:

+

{_t("To continue, please enter your password.")}

+

{_t("Password:")}


- diff --git a/src/components/views/room_settings/AliasSettings.js b/src/components/views/room_settings/AliasSettings.js index b48c5a4fe2..b9c9c7d989 100644 --- a/src/components/views/room_settings/AliasSettings.js +++ b/src/components/views/room_settings/AliasSettings.js @@ -230,7 +230,7 @@ module.exports = React.createClass({ remote_aliases_section = (
- Remote addresses for this room: + {_t("Remote addresses for this room:")}
{ this.state.remoteDomains.map((domain, i) => { diff --git a/src/components/views/room_settings/UrlPreviewSettings.js b/src/components/views/room_settings/UrlPreviewSettings.js index d221cd4fd8..e5236b90cc 100644 --- a/src/components/views/room_settings/UrlPreviewSettings.js +++ b/src/components/views/room_settings/UrlPreviewSettings.js @@ -20,7 +20,7 @@ var MatrixClientPeg = require('../../../MatrixClientPeg'); var sdk = require("../../../index"); var Modal = require("../../../Modal"); var UserSettingsStore = require('../../../UserSettingsStore'); -import { _t } from '../../../languageHandler'; +import { _t, _tJsx } from '../../../languageHandler'; module.exports = React.createClass({ @@ -131,12 +131,24 @@ module.exports = React.createClass({ ; } + let urlPreviewText = null; + if (UserSettingsStore.getUrlPreviewsDisabled()) { + urlPreviewText = ( + _tJsx("You have disabled URL previews by default.", /(.*?)<\/a>/, (sub)=>{sub}) + ); + } + else { + urlPreviewText = ( + _tJsx("You have enabled URL previews by default.", /(.*?)<\/a>/, (sub)=>{sub}) + ); + } + return (

{_t("URL Previews")}

{ disableRoomPreviewUrls }