Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 6225e40

Browse files
committed
i18n'ed all over the plaace
1 parent 7ee5f7b commit 6225e40

File tree

3 files changed

+45
-25
lines changed

3 files changed

+45
-25
lines changed

src/components/views/dialogs/RoomSettingsDialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import BridgeSettingsTab from "../settings/tabs/room/BridgeSettingsTab";
2828
import sdk from "../../../index";
2929
import MatrixClientPeg from "../../../MatrixClientPeg";
3030
import dis from "../../../dispatcher";
31-
import SettingsStore from "../settings/SettingsStore";
31+
import SettingsStore from "../../../settings/SettingsStore";
3232

3333
export default class RoomSettingsDialog extends React.Component {
3434
static propTypes = {

src/components/views/settings/tabs/room/BridgeSettingsTab.js

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,31 @@ export default class BridgeSettingsTab extends React.Component {
5252
const { channel, network } = content;
5353
const protocolName = content.protocol.displayname || content.protocol.id;
5454
const channelName = channel.displayname || channel.id;
55-
const networkName = network ? network.displayname || network.id : "";
55+
const networkName = network ? network.displayname || network.id : protocolName;
5656

5757
let creator = null;
5858
if (content.creator) {
59-
creator = (<p>
60-
This bridge was provisioned by <Pill
61-
type={Pill.TYPE_USER_MENTION}
62-
room={room}
63-
url={makeUserPermalink(content.creator)}
64-
shouldShowPillAvatar={true}
65-
/>
66-
</p>);
59+
const pill = <Pill
60+
type={Pill.TYPE_USER_MENTION}
61+
room={room}
62+
url={makeUserPermalink(content.creator)}
63+
shouldShowPillAvatar={true}
64+
/>;
65+
creator = (<p>{
66+
_t("This bridge was provisioned by %(pill)s", {
67+
pill,
68+
})
69+
} </p>);
6770
}
6871

69-
const bot = (<p>
70-
The bridge is managed by the <Pill
71-
type={Pill.TYPE_USER_MENTION}
72-
room={room}
73-
url={makeUserPermalink(event.getSender())}
74-
shouldShowPillAvatar={true}
75-
/> bot user.</p>
76-
);
72+
const bot = (<p> {_t("This bridge is managed by the %(pill)s bot user.", {
73+
pill: <Pill
74+
type={Pill.TYPE_USER_MENTION}
75+
room={room}
76+
url={makeUserPermalink(event.getSender())}
77+
shouldShowPillAvatar={true}
78+
/>,
79+
})} </p>);
7780
let channelLink = channelName;
7881
if (channel.external_url) {
7982
channelLink = <a target="_blank" href={channel.external_url}>{channelName}</a>;
@@ -85,7 +88,11 @@ export default class BridgeSettingsTab extends React.Component {
8588
}
8689

8790
const chanAndNetworkInfo = (
88-
<p> Bridged into {channelLink} {networkLink}, on {protocolName}</p>
91+
(_t("Bridged into %(channelLink)s %(networkLink)s, on %(protocolName)s", {
92+
channelLink,
93+
networkLink,
94+
protocolName,
95+
}))
8996
);
9097

9198
let networkIcon = null;
@@ -111,14 +118,21 @@ export default class BridgeSettingsTab extends React.Component {
111118
url={ avatarUrl } />;
112119
}
113120

121+
const heading = _t("Connected to %(channelIcon)s %(channelName)s on %(networkIcon)s %(networkName)s", {
122+
channelIcon,
123+
channelName,
124+
networkName,
125+
networkIcon,
126+
});
127+
114128
return (<li key={event.stateKey}>
115129
<div>
116-
<h3>{channelIcon} {channelName} {networkName ? ` on ${networkName}` : ""} {networkIcon}</h3>
117-
<p> Connected via {protocolName} </p>
130+
<h3> {heading} </h3>
131+
<p>{_t("Connected via %(protocolName)s", { protocolName })}</p>
118132
<details>
119133
{creator}
120134
{bot}
121-
{chanAndNetworkInfo}
135+
<p>{chanAndNetworkInfo}</p>
122136
</details>
123137
</div>
124138
</li>);
@@ -146,7 +160,7 @@ export default class BridgeSettingsTab extends React.Component {
146160
<div className="mx_SettingsTab">
147161
<div className="mx_SettingsTab_heading">{_t("Bridge Info")}</div>
148162
<div className='mx_SettingsTab_section mx_SettingsTab_subsectionText'>
149-
<p> Below is a list of bridges connected to this room. </p>
163+
<p>{ _t("Below is a list of bridges connected to this room.") }</p>
150164
<ul className="mx_RoomSettingsDialog_BridgeList">
151165
{ bridgeEvents.map((event) => this._renderBridgeCard(event, room)) }
152166
</ul>

src/i18n/strings/en_EN.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@
342342
"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.",
343343
"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)",
344344
"Enable local event indexing and E2EE search (requires restart)": "Enable local event indexing and E2EE search (requires restart)",
345+
"Show info about bridges in room settings": "Show info about bridges in room settings",
345346
"Use the new, faster, composer for writing messages": "Use the new, faster, composer for writing messages",
346347
"Enable Emoji suggestions while typing": "Enable Emoji suggestions while typing",
347348
"Use compact timeline layout": "Use compact timeline layout",
@@ -725,7 +726,13 @@
725726
"Room version:": "Room version:",
726727
"Developer options": "Developer options",
727728
"Open Devtools": "Open Devtools",
729+
"This bridge was provisioned by %(pill)s": "This bridge was provisioned by %(pill)s",
730+
"This bridge is managed by the %(pill)s bot user.": "This bridge is managed by the %(pill)s bot user.",
731+
"Bridged into %(channelLink)s %(networkLink)s, on %(protocolName)s": "Bridged into %(channelLink)s %(networkLink)s, on %(protocolName)s",
732+
"Connected to %(channelIcon)s %(channelName)s on %(networkIcon)s %(networkName)s": "Connected to %(channelIcon)s %(channelName)s on %(networkIcon)s %(networkName)s",
733+
"Connected via %(protocolName)s": "Connected via %(protocolName)s",
728734
"Bridge Info": "Bridge Info",
735+
"Below is a list of bridges connected to this room.": "Below is a list of bridges connected to this room.",
729736
"Room Addresses": "Room Addresses",
730737
"Publish this room to the public in %(domain)s's room directory?": "Publish this room to the public in %(domain)s's room directory?",
731738
"URL Previews": "URL Previews",
@@ -1932,6 +1939,5 @@
19321939
"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.",
19331940
"Failed to set direct chat tag": "Failed to set direct chat tag",
19341941
"Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",
1935-
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room",
1936-
"Show info about bridges in room settings": "Show info about bridges in room settings"
1942+
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room"
19371943
}

0 commit comments

Comments
 (0)