Update copy

This commit is contained in:
Michael Telatynski 2021-09-29 16:05:03 +01:00
parent 886f8d31fb
commit 0697470cc8
3 changed files with 17 additions and 56 deletions

View File

@ -15,11 +15,11 @@ limitations under the License.
*/
import React, { ComponentProps, useMemo, useState } from 'react';
import ConfirmUserActionDialog from "./ConfirmUserActionDialog";
import SpaceStore from "../../../stores/SpaceStore";
import { Room } from "matrix-js-sdk/src/models/room";
import SpaceChildrenPicker from "../spaces/SpaceChildrenPicker";
import { _t } from '../../../languageHandler';
type BaseProps = ComponentProps<typeof ConfirmUserActionDialog>;
interface IProps extends Omit<BaseProps, "groupMember" | "matrixClient" | "children" | "onFinished"> {
@ -54,14 +54,7 @@ const ConfirmSpaceUserActionDialog: React.FC<IProps> = ({
const selectedRooms = useMemo(() => new Set(roomsToLeave), [roomsToLeave]);
let warning: JSX.Element;
if (!spaceChildren.length) {
warning = <div className="mx_ConfirmSpaceUserActionDialog_warning">
{ _t("Youre not an admin of anything theyre a member of in <SpaceName/>, " +
"so banning wont remove them from any rooms or spaces in <SpaceName/>.", {}, {
SpaceName: () => <b>{ space.name }</b>,
}) }
</div>;
} else if (warningMessage) {
if (warningMessage) {
warning = <div className="mx_ConfirmSpaceUserActionDialog_warning">
{ warningMessage }
</div>;

View File

@ -541,21 +541,6 @@ const RoomKickButton = ({ room, member, startUpdating, stopUpdating }: Omit<IBas
if (member.membership !== "invite" && member.membership !== "join") return null;
const onKick = async () => {
let title: string;
if (room.isSpaceRoom()) {
if (member.membership === "invite") {
title = _t("Disinvite this user from %(spaceName)s?", { spaceName: room.name });
} else {
title = _t("Kick this user from %(spaceName)s?", { spaceName: room.name });
}
} else {
if (member.membership === "invite") {
title = _t("Disinvite this user?");
} else {
title = _t("Kick this user?");
}
}
const { finished } = Modal.createTrackedDialog(
'Confirm User Action Dialog',
'onKick',
@ -563,7 +548,9 @@ const RoomKickButton = ({ room, member, startUpdating, stopUpdating }: Omit<IBas
{
member,
action: member.membership === "invite" ? _t("Disinvite") : _t("Kick"),
title,
title: member.membership === "invite"
? _t("Disinvite from %(roomName)s", { roomName: room.name })
: _t("Kick from %(roomName)s", { roomName: room.name }),
askReason: member.membership === "join",
danger: true,
// space-specific props
@ -579,7 +566,7 @@ const RoomKickButton = ({ room, member, startUpdating, stopUpdating }: Omit<IBas
allLabel: _t("Kick them from everything I'm able to"),
specificLabel: _t("Kick them from specific things I'm able to"),
warningMessage: _t("If you're not an admin of a room or space in <SpaceName/>, " +
"they'll still be able to access it after you kick them.", {}, {
"they'll still be able to access whatever you're not an admin of.", {}, {
SpaceName: () => <b>{ room.name }</b>,
}),
},
@ -696,21 +683,6 @@ const BanToggleButton = ({ room, member, startUpdating, stopUpdating }: Omit<IBa
const isBanned = member.membership === "ban";
const onBanOrUnban = async () => {
let title: string;
if (room.isSpaceRoom()) {
if (isBanned) {
title = _t("Unban this user from %(spaceName)s?", { spaceName: room.name });
} else {
title = _t("Ban this user from %(spaceName)s?", { spaceName: room.name });
}
} else {
if (isBanned) {
title = _t("Unban this user?");
} else {
title = _t("Ban this user?");
}
}
const { finished } = Modal.createTrackedDialog(
'Confirm User Action Dialog',
'onBanOrUnban',
@ -718,7 +690,9 @@ const BanToggleButton = ({ room, member, startUpdating, stopUpdating }: Omit<IBa
{
member,
action: isBanned ? _t("Unban") : _t("Ban"),
title,
title: isBanned
? _t("Unban from %(roomName)s", { roomName: room.name })
: _t("Ban from %(roomName)s", { roomName: room.name }),
askReason: !isBanned,
danger: !isBanned,
// space-specific props
@ -748,11 +722,11 @@ const BanToggleButton = ({ room, member, startUpdating, stopUpdating }: Omit<IBa
: _t("Ban them from specific things I'm able to"),
warningMessage: isBanned
? _t("If youre not an admin of a room or space in <SpaceName/>, " +
"they wont be unbanned from it.", {}, {
"they still won't be able to access whatever you're not an admin of.", {}, {
SpaceName: () => <b>{ room.name }</b>,
})
: _t("If you're not an admin of a room or space in <SpaceName/>, " +
"they'll still be able to access it after you ban them.", {}, {
"they'll still be able to access whatever you're not an admin of.", {}, {
SpaceName: () => <b>{ room.name }</b>,
}),
},

View File

@ -1845,15 +1845,13 @@
"You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the space it will be impossible to regain privileges.": "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the space it will be impossible to regain privileges.",
"You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the room it will be impossible to regain privileges.": "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the room it will be impossible to regain privileges.",
"Demote": "Demote",
"Disinvite this user from %(spaceName)s?": "Disinvite this user from %(spaceName)s?",
"Kick this user from %(spaceName)s?": "Kick this user from %(spaceName)s?",
"Disinvite this user?": "Disinvite this user?",
"Kick this user?": "Kick this user?",
"Disinvite": "Disinvite",
"Kick": "Kick",
"Disinvite from %(roomName)s": "Disinvite from %(roomName)s",
"Kick from %(roomName)s": "Kick from %(roomName)s",
"Kick them from everything I'm able to": "Kick them from everything I'm able to",
"Kick them from specific things I'm able to": "Kick them from specific things I'm able to",
"If you're not an admin of a room or space in <SpaceName/>, they'll still be able to access it after you kick them.": "If you're not an admin of a room or space in <SpaceName/>, they'll still be able to access it after you kick them.",
"If you're not an admin of a room or space in <SpaceName/>, they'll still be able to access whatever you're not an admin of.": "If you're not an admin of a room or space in <SpaceName/>, they'll still be able to access whatever you're not an admin of.",
"Failed to kick": "Failed to kick",
"No recent messages by %(user)s found": "No recent messages by %(user)s found",
"Try scrolling up in the timeline to see if there are any earlier ones.": "Try scrolling up in the timeline to see if there are any earlier ones.",
@ -1864,17 +1862,14 @@
"Remove %(count)s messages|other": "Remove %(count)s messages",
"Remove %(count)s messages|one": "Remove 1 message",
"Remove recent messages": "Remove recent messages",
"Unban this user from %(spaceName)s?": "Unban this user from %(spaceName)s?",
"Ban this user from %(spaceName)s?": "Ban this user from %(spaceName)s?",
"Unban this user?": "Unban this user?",
"Ban this user?": "Ban this user?",
"Ban": "Ban",
"Unban from %(roomName)s": "Unban 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",
"Ban them from everything I'm able to": "Ban them from everything I'm able to",
"Unban them from specific things I'm able to": "Unban them from specific things I'm able to",
"Ban them from specific things I'm able to": "Ban them from specific things I'm able to",
"If youre not an admin of a room or space in <SpaceName/>, they wont be unbanned from it.": "If youre not an admin of a room or space in <SpaceName/>, they wont be unbanned from it.",
"If you're not an admin of a room or space in <SpaceName/>, they'll still be able to access it after you ban them.": "If you're not an admin of a room or space in <SpaceName/>, they'll still be able to access it after you ban them.",
"If youre not an admin of a room or space in <SpaceName/>, they still won't be able to access whatever you're not an admin of.": "If youre not an admin of a room or space in <SpaceName/>, they still won't be able to access whatever you're not an admin of.",
"Failed to ban user": "Failed to ban user",
"Failed to mute user": "Failed to mute user",
"Unmute": "Unmute",
@ -2233,7 +2228,6 @@
"Confirm Removal": "Confirm Removal",
"Are you sure you wish to remove (delete) this event? Note that if you delete a room name or topic change, it could undo the change.": "Are you sure you wish to remove (delete) this event? Note that if you delete a room name or topic change, it could undo the change.",
"Reason (optional)": "Reason (optional)",
"Youre not an admin of anything theyre a member of in <SpaceName/>, so banning wont remove them from any rooms or spaces in <SpaceName/>.": "Youre not an admin of anything theyre a member of in <SpaceName/>, so banning wont remove them from any rooms or spaces in <SpaceName/>.",
"Clear all data in this session?": "Clear all data in this session?",
"Clearing all data from this session is permanent. Encrypted messages will be lost unless their keys have been backed up.": "Clearing all data from this session is permanent. Encrypted messages will be lost unless their keys have been backed up.",
"Clear all data": "Clear all data",