Change "Ban" to "Ban from room" to fix an inconsistency in the Admin Tools dialog (#8281)

* fix-admin-tools-phrase-inconsistency

* correctly specify space room action

* run i18n

* Apply suggestions from code review

Revert the applied formatting.

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Emmanuel 2022-04-14 22:01:32 +01:00 committed by GitHub
parent eb1d9b8f41
commit 8eaae6bdbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 6 deletions

View File

@ -178,7 +178,7 @@ function useHasCrossSigningKeys(cli: MatrixClient, member: User, canVerify: bool
}, [cli, member, canVerify], undefined); }, [cli, member, canVerify], undefined);
} }
function DeviceItem({ userId, device }: {userId: string, device: IDevice}) { function DeviceItem({ userId, device }: { userId: string, device: IDevice }) {
const cli = useContext(MatrixClientContext); const cli = useContext(MatrixClientContext);
const isMe = userId === cli.getUserId(); const isMe = userId === cli.getUserId();
const deviceTrust = cli.checkDeviceTrust(userId, device.deviceId); const deviceTrust = cli.checkDeviceTrust(userId, device.deviceId);
@ -239,7 +239,7 @@ function DeviceItem({ userId, device }: {userId: string, device: IDevice}) {
} }
} }
function DevicesSection({ devices, userId, loading }: {devices: IDevice[], userId: string, loading: boolean}) { function DevicesSection({ devices, userId, loading }: { devices: IDevice[], userId: string, loading: boolean }) {
const cli = useContext(MatrixClientContext); const cli = useContext(MatrixClientContext);
const userTrust = cli.checkUserTrust(userId); const userTrust = cli.checkUserTrust(userId);
@ -653,7 +653,9 @@ const BanToggleButton = ({ room, member, startUpdating, stopUpdating }: Omit<IBa
room.isSpaceRoom() ? ConfirmSpaceUserActionDialog : ConfirmUserActionDialog, room.isSpaceRoom() ? ConfirmSpaceUserActionDialog : ConfirmUserActionDialog,
{ {
member, member,
action: isBanned ? _t("Unban") : _t("Ban"), action: room.isSpaceRoom()
? (isBanned ? _t("Unban from space") : _t("Ban from space"))
: (isBanned ? _t("Unban from room") : _t("Ban from room")),
title: isBanned title: isBanned
? _t("Unban from %(roomName)s", { roomName: room.name }) ? _t("Unban from %(roomName)s", { roomName: room.name })
: _t("Ban from %(roomName)s", { roomName: room.name }), : _t("Ban from %(roomName)s", { roomName: room.name }),
@ -719,9 +721,13 @@ const BanToggleButton = ({ room, member, startUpdating, stopUpdating }: Omit<IBa
}); });
}; };
let label = _t("Ban"); let label = room.isSpaceRoom()
? _t("Ban from space")
: _t("Ban from room");
if (isBanned) { if (isBanned) {
label = _t("Unban"); label = room.isSpaceRoom()
? _t("Unban from space")
: _t("Unban from room");
} }
const classes = classNames("mx_UserInfo_field", { const classes = classNames("mx_UserInfo_field", {

View File

@ -1992,7 +1992,10 @@
"Failed to remove user": "Failed to remove user", "Failed to remove user": "Failed to remove user",
"Remove from room": "Remove from room", "Remove from room": "Remove from room",
"Remove recent messages": "Remove recent messages", "Remove recent messages": "Remove recent messages",
"Ban": "Ban", "Unban from space": "Unban from space",
"Ban from space": "Ban from space",
"Unban from room": "Unban from room",
"Ban from room": "Ban from room",
"Unban from %(roomName)s": "Unban from %(roomName)s", "Unban from %(roomName)s": "Unban from %(roomName)s",
"Ban from %(roomName)s": "Ban from %(roomName)s", "Ban from %(roomName)s": "Ban from %(roomName)s",
"Unban them from everything I'm able to": "Unban them from everything I'm able to", "Unban them from everything I'm able to": "Unban them from everything I'm able to",