diff --git a/src/components/views/dialogs/RoomSettingsDialog.js b/src/components/views/dialogs/RoomSettingsDialog.js index 2952439076..9ac2b17f23 100644 --- a/src/components/views/dialogs/RoomSettingsDialog.js +++ b/src/components/views/dialogs/RoomSettingsDialog.js @@ -28,7 +28,7 @@ import BridgeSettingsTab from "../settings/tabs/room/BridgeSettingsTab"; import sdk from "../../../index"; import MatrixClientPeg from "../../../MatrixClientPeg"; import dis from "../../../dispatcher"; -import SettingsStore from "../settings/SettingsStore"; +import SettingsStore from "../../../settings/SettingsStore"; export default class RoomSettingsDialog extends React.Component { static propTypes = { diff --git a/src/components/views/settings/tabs/room/BridgeSettingsTab.js b/src/components/views/settings/tabs/room/BridgeSettingsTab.js index a165a1db44..82382e7828 100644 --- a/src/components/views/settings/tabs/room/BridgeSettingsTab.js +++ b/src/components/views/settings/tabs/room/BridgeSettingsTab.js @@ -52,28 +52,31 @@ export default class BridgeSettingsTab extends React.Component { const { channel, network } = content; const protocolName = content.protocol.displayname || content.protocol.id; const channelName = channel.displayname || channel.id; - const networkName = network ? network.displayname || network.id : ""; + const networkName = network ? network.displayname || network.id : protocolName; let creator = null; if (content.creator) { - creator = (<p> - This bridge was provisioned by <Pill - type={Pill.TYPE_USER_MENTION} - room={room} - url={makeUserPermalink(content.creator)} - shouldShowPillAvatar={true} - /> - </p>); + const pill = <Pill + type={Pill.TYPE_USER_MENTION} + room={room} + url={makeUserPermalink(content.creator)} + shouldShowPillAvatar={true} + />; + creator = (<p>{ + _t("This bridge was provisioned by %(pill)s", { + pill, + }) + } </p>); } - const bot = (<p> - The bridge is managed by the <Pill - type={Pill.TYPE_USER_MENTION} - room={room} - url={makeUserPermalink(event.getSender())} - shouldShowPillAvatar={true} - /> bot user.</p> - ); + const bot = (<p> {_t("This bridge is managed by the %(pill)s bot user.", { + pill: <Pill + type={Pill.TYPE_USER_MENTION} + room={room} + url={makeUserPermalink(event.getSender())} + shouldShowPillAvatar={true} + />, + })} </p>); let channelLink = channelName; if (channel.external_url) { channelLink = <a target="_blank" href={channel.external_url}>{channelName}</a>; @@ -85,7 +88,11 @@ export default class BridgeSettingsTab extends React.Component { } const chanAndNetworkInfo = ( - <p> Bridged into {channelLink} {networkLink}, on {protocolName}</p> + (_t("Bridged into %(channelLink)s %(networkLink)s, on %(protocolName)s", { + channelLink, + networkLink, + protocolName, + })) ); let networkIcon = null; @@ -111,14 +118,21 @@ export default class BridgeSettingsTab extends React.Component { url={ avatarUrl } />; } + const heading = _t("Connected to %(channelIcon)s %(channelName)s on %(networkIcon)s %(networkName)s", { + channelIcon, + channelName, + networkName, + networkIcon, + }); + return (<li key={event.stateKey}> <div> - <h3>{channelIcon} {channelName} {networkName ? ` on ${networkName}` : ""} {networkIcon}</h3> - <p> Connected via {protocolName} </p> + <h3> {heading} </h3> + <p>{_t("Connected via %(protocolName)s", { protocolName })}</p> <details> {creator} {bot} - {chanAndNetworkInfo} + <p>{chanAndNetworkInfo}</p> </details> </div> </li>); @@ -146,7 +160,7 @@ export default class BridgeSettingsTab extends React.Component { <div className="mx_SettingsTab"> <div className="mx_SettingsTab_heading">{_t("Bridge Info")}</div> <div className='mx_SettingsTab_section mx_SettingsTab_subsectionText'> - <p> Below is a list of bridges connected to this room. </p> + <p>{ _t("Below is a list of bridges connected to this room.") }</p> <ul className="mx_RoomSettingsDialog_BridgeList"> { bridgeEvents.map((event) => this._renderBridgeCard(event, room)) } </ul> diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 14ba96fa4a..b76310ec27 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -342,6 +342,7 @@ "Send verification requests in direct message, including a new verification UX in the member panel.": "Send verification requests in direct message, including a new verification UX in the member panel.", "Enable cross-signing to verify per-user instead of per-device (in development)": "Enable cross-signing to verify per-user instead of per-device (in development)", "Enable local event indexing and E2EE search (requires restart)": "Enable local event indexing and E2EE search (requires restart)", + "Show info about bridges in room settings": "Show info about bridges in room settings", "Use the new, faster, composer for writing messages": "Use the new, faster, composer for writing messages", "Enable Emoji suggestions while typing": "Enable Emoji suggestions while typing", "Use compact timeline layout": "Use compact timeline layout", @@ -725,7 +726,13 @@ "Room version:": "Room version:", "Developer options": "Developer options", "Open Devtools": "Open Devtools", + "This bridge was provisioned by %(pill)s": "This bridge was provisioned by %(pill)s", + "This bridge is managed by the %(pill)s bot user.": "This bridge is managed by the %(pill)s bot user.", + "Bridged into %(channelLink)s %(networkLink)s, on %(protocolName)s": "Bridged into %(channelLink)s %(networkLink)s, on %(protocolName)s", + "Connected to %(channelIcon)s %(channelName)s on %(networkIcon)s %(networkName)s": "Connected to %(channelIcon)s %(channelName)s on %(networkIcon)s %(networkName)s", + "Connected via %(protocolName)s": "Connected via %(protocolName)s", "Bridge Info": "Bridge Info", + "Below is a list of bridges connected to this room.": "Below is a list of bridges connected to this room.", "Room Addresses": "Room Addresses", "Publish this room to the public in %(domain)s's room directory?": "Publish this room to the public in %(domain)s's room directory?", "URL Previews": "URL Previews", @@ -1932,6 +1939,5 @@ "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.": "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.", "Failed to set direct chat tag": "Failed to set direct chat tag", "Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room", - "Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room", - "Show info about bridges in room settings": "Show info about bridges in room settings" + "Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room" }