From 4483d4cf1b8718c43e1ecf5f3ff11d1df7419388 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 6 Jan 2022 09:56:02 +0000 Subject: [PATCH 1/4] Replace `kick` terminology with `Remove from chat` --- src/SlashCommands.tsx | 5 +-- src/TextForEvent.tsx | 4 +-- .../views/elements/MemberEventListSummary.tsx | 4 +-- src/components/views/right_panel/UserInfo.tsx | 12 +++---- src/components/views/rooms/RoomPreviewBar.tsx | 2 +- .../tabs/room/RolesRoomSettingsTab.tsx | 2 +- src/i18n/strings/en_EN.json | 33 +++++++++---------- src/settings/Settings.tsx | 2 +- src/widgets/CapabilityText.tsx | 4 +-- .../elements/MemberEventListSummary-test.js | 2 +- .../RoomPreviewBar-test.tsx.snap | 4 +-- 11 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index 0004f786280..800b5167046 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -691,9 +691,10 @@ export const Commands = [ renderingTypes: [TimelineRenderingType.Room], }), new Command({ - command: 'kick', + command: 'remove', + aliases: ["kick"], args: ' [reason]', - description: _td('Kicks user with given id'), + description: _td('Removes user with given id from this room'), runFn: function(roomId, args) { if (args) { const matches = args.match(/^(\S+?)( +(.*))?$/); diff --git a/src/TextForEvent.tsx b/src/TextForEvent.tsx index 14d4768e83e..627fda789d6 100644 --- a/src/TextForEvent.tsx +++ b/src/TextForEvent.tsx @@ -156,12 +156,12 @@ function textForMemberEvent(ev: MatrixEvent, allowJSX: boolean, showHiddenEvents : _t('%(senderName)s withdrew %(targetName)s\'s invitation', { senderName, targetName }); } else if (prevContent.membership === "join") { return () => reason - ? _t('%(senderName)s kicked %(targetName)s: %(reason)s', { + ? _t('%(senderName)s removed %(targetName)s: %(reason)s', { senderName, targetName, reason, }) - : _t('%(senderName)s kicked %(targetName)s', { senderName, targetName }); + : _t('%(senderName)s removed %(targetName)s', { senderName, targetName }); } else { return null; } diff --git a/src/components/views/elements/MemberEventListSummary.tsx b/src/components/views/elements/MemberEventListSummary.tsx index 53a604fe9d7..553e1c24915 100644 --- a/src/components/views/elements/MemberEventListSummary.tsx +++ b/src/components/views/elements/MemberEventListSummary.tsx @@ -294,8 +294,8 @@ export default class MemberEventListSummary extends React.Component { break; case "kicked": res = (userCount > 1) - ? _t("were kicked %(count)s times", { count: repeats }) - : _t("was kicked %(count)s times", { count: repeats }); + ? _t("were removed %(count)s times", { count: repeats }) + : _t("was removed %(count)s times", { count: repeats }); break; case "changed_name": res = (userCount > 1) diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index d7911fc9d63..b7414a6c53c 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -567,10 +567,10 @@ const RoomKickButton = ({ room, member, startUpdating, stopUpdating }: Omit theirMember.powerLevel && child.currentState.hasSufficientPowerLevelFor("kick", myMember.powerLevel); }, - allLabel: _t("Kick them from everything I'm able to"), - specificLabel: _t("Kick them from specific things I'm able to"), + allLabel: _t("Remove them from everything I'm able to"), + specificLabel: _t("Remove them from specific things I'm able to"), warningMessage: _t("They'll still be able to access whatever you're not an admin of."), }, room.isSpaceRoom() ? "mx_ConfirmSpaceUserActionDialog_wrapper" : undefined, @@ -602,7 +602,7 @@ const RoomKickButton = ({ room, member, startUpdating, stopUpdating }: Omit { @@ -610,7 +610,7 @@ const RoomKickButton = ({ room, member, startUpdating, stopUpdating }: Omit { kickLabel } ; diff --git a/src/components/views/rooms/RoomPreviewBar.tsx b/src/components/views/rooms/RoomPreviewBar.tsx index 79351a8b92e..f0a4df2473d 100644 --- a/src/components/views/rooms/RoomPreviewBar.tsx +++ b/src/components/views/rooms/RoomPreviewBar.tsx @@ -359,7 +359,7 @@ export default class RoomPreviewBar extends React.Component { } case MessageCase.Kicked: { const { memberName, reason } = this.getKickOrBanInfo(); - title = _t("You were kicked from %(roomName)s by %(memberName)s", + title = _t("You were removed from %(roomName)s by %(memberName)s", { memberName, roomName: this.roomName() }); subTitle = reason ? _t("Reason: %(reason)s", { reason }) : null; diff --git a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx index 87ef5ea2538..62f49786259 100644 --- a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx @@ -263,7 +263,7 @@ export default class RolesRoomSettingsTab extends React.Component { defaultValue: 50, }, "kick": { - desc: _t('Kick users'), + desc: _t('Remove users'), defaultValue: 50, }, "ban": { diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index ba509221876..69042c587d4 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -453,7 +453,7 @@ "Joins room with given address": "Joins room with given address", "Leave room": "Leave room", "Unrecognised room address:": "Unrecognised room address:", - "Kicks user with given id": "Kicks user with given id", + "Removes user with given id from this room": "Removes user with given id from this room", "Bans user with given id": "Bans user with given id", "Unbans user with given ID": "Unbans user with given ID", "Ignores a user, hiding their messages from you": "Ignores a user, hiding their messages from you", @@ -515,8 +515,8 @@ "%(senderName)s unbanned %(targetName)s": "%(senderName)s unbanned %(targetName)s", "%(senderName)s withdrew %(targetName)s's invitation: %(reason)s": "%(senderName)s withdrew %(targetName)s's invitation: %(reason)s", "%(senderName)s withdrew %(targetName)s's invitation": "%(senderName)s withdrew %(targetName)s's invitation", - "%(senderName)s kicked %(targetName)s: %(reason)s": "%(senderName)s kicked %(targetName)s: %(reason)s", - "%(senderName)s kicked %(targetName)s": "%(senderName)s kicked %(targetName)s", + "%(senderName)s removed %(targetName)s: %(reason)s": "%(senderName)s removed %(targetName)s: %(reason)s", + "%(senderName)s removed %(targetName)s": "%(senderName)s removed %(targetName)s", "%(senderDisplayName)s changed the topic to \"%(topic)s\".": "%(senderDisplayName)s changed the topic to \"%(topic)s\".", "%(senderDisplayName)s changed the room avatar.": "%(senderDisplayName)s changed the room avatar.", "%(senderDisplayName)s removed the room name.": "%(senderDisplayName)s removed the room name.", @@ -611,9 +611,9 @@ "See when the avatar changes in this room": "See when the avatar changes in this room", "Change the avatar of your active room": "Change the avatar of your active room", "See when the avatar changes in your active room": "See when the avatar changes in your active room", - "Kick, ban, or invite people to this room, and make you leave": "Kick, ban, or invite people to this room, and make you leave", + "Remove, ban, or invite people to this room, and make you leave": "Remove, ban, or invite people to this room, and make you leave", "See when people join, leave, or are invited to this room": "See when people join, leave, or are invited to this room", - "Kick, ban, or invite people to your active room, and make you leave": "Kick, ban, or invite people to your active room, and make you leave", + "Remove, ban, or invite people to your active room, and make you leave": "Remove, ban, or invite people to your active room, and make you leave", "See when people join, leave, or are invited to your active room": "See when people join, leave, or are invited to your active room", "Send stickers to this room as you": "Send stickers to this room as you", "See when a sticker is posted in this room": "See when a sticker is posted in this room", @@ -891,7 +891,7 @@ "Show stickers button": "Show stickers button", "Use a more compact 'Modern' layout": "Use a more compact 'Modern' layout", "Show a placeholder for removed messages": "Show a placeholder for removed messages", - "Show join/leave messages (invites/kicks/bans unaffected)": "Show join/leave messages (invites/kicks/bans unaffected)", + "Show join/leave messages (invites/removes/bans unaffected)": "Show join/leave messages (invites/removes/bans unaffected)", "Show avatar changes": "Show avatar changes", "Show display name changes": "Show display name changes", "Show read receipts sent by other users": "Show read receipts sent by other users", @@ -1560,7 +1560,7 @@ "Send messages": "Send messages", "Invite users": "Invite users", "Change settings": "Change settings", - "Kick users": "Kick users", + "Remove users": "Remove users", "Ban users": "Ban users", "Remove messages sent by others": "Remove messages sent by others", "Notify everyone": "Notify everyone", @@ -1783,7 +1783,7 @@ "Join the conversation with an account": "Join the conversation with an account", "Sign Up": "Sign Up", "Loading room preview": "Loading room preview", - "You were kicked from %(roomName)s by %(memberName)s": "You were kicked from %(roomName)s by %(memberName)s", + "You were removed from %(roomName)s by %(memberName)s": "You were removed from %(roomName)s by %(memberName)s", "Reason: %(reason)s": "Reason: %(reason)s", "Forget this room": "Forget this room", "Re-join": "Re-join", @@ -1956,13 +1956,14 @@ "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": "Disinvite", - "Kick": "Kick", + "Remove from chat": "Remove from chat", "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", + "Remove from %(roomName)s": "Remove from %(roomName)s", + "Remove them from everything I'm able to": "Remove them from everything I'm able to", + "Remove them from specific things I'm able to": "Remove them from specific things I'm able to", "They'll still be able to access whatever you're not an admin of.": "They'll still be able to access whatever you're not an admin of.", - "Failed to kick": "Failed to kick", + "Failed to remove user": "Failed to remove user", + "Remove from room": "Remove from room", "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.", "Remove recent messages by %(user)s": "Remove recent messages by %(user)s", @@ -2243,10 +2244,8 @@ "were unbanned %(count)s times|one": "were unbanned", "was unbanned %(count)s times|other": "was unbanned %(count)s times", "was unbanned %(count)s times|one": "was unbanned", - "were kicked %(count)s times|other": "were kicked %(count)s times", - "were kicked %(count)s times|one": "were kicked", - "was kicked %(count)s times|other": "was kicked %(count)s times", - "was kicked %(count)s times|one": "was kicked", + "were removed %(count)s times|other": "were removed %(count)s times", + "was removed %(count)s times|other": "was removed %(count)s times", "%(severalUsers)schanged their name %(count)s times|other": "%(severalUsers)schanged their name %(count)s times", "%(severalUsers)schanged their name %(count)s times|one": "%(severalUsers)schanged their name", "%(oneUser)schanged their name %(count)s times|other": "%(oneUser)schanged their name %(count)s times", diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index f09eca83490..4a82dcf606e 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -426,7 +426,7 @@ export const SETTINGS: {[setting: string]: ISetting} = { }, "showJoinLeaves": { supportedLevels: LEVELS_ROOM_SETTINGS_WITH_ROOM, - displayName: _td('Show join/leave messages (invites/kicks/bans unaffected)'), + displayName: _td('Show join/leave messages (invites/removes/bans unaffected)'), default: true, invertedSettingName: 'hideJoinLeaves', }, diff --git a/src/widgets/CapabilityText.tsx b/src/widgets/CapabilityText.tsx index f9c8c9427f0..cd442f213b8 100644 --- a/src/widgets/CapabilityText.tsx +++ b/src/widgets/CapabilityText.tsx @@ -110,11 +110,11 @@ export class CapabilityText { }, [EventType.RoomMember]: { [WidgetKind.Room]: { - [EventDirection.Send]: _td("Kick, ban, or invite people to this room, and make you leave"), + [EventDirection.Send]: _td("Remove, ban, or invite people to this room, and make you leave"), [EventDirection.Receive]: _td("See when people join, leave, or are invited to this room"), }, [GENERIC_WIDGET_KIND]: { - [EventDirection.Send]: _td("Kick, ban, or invite people to your active room, and make you leave"), + [EventDirection.Send]: _td("Remove, ban, or invite people to your active room, and make you leave"), [EventDirection.Receive]: _td("See when people join, leave, or are invited to your active room"), }, }, diff --git a/test/components/views/elements/MemberEventListSummary-test.js b/test/components/views/elements/MemberEventListSummary-test.js index 834e5a67a9a..8eee681ffe9 100644 --- a/test/components/views/elements/MemberEventListSummary-test.js +++ b/test/components/views/elements/MemberEventListSummary-test.js @@ -516,7 +516,7 @@ describe('MemberEventListSummary', function() { expect(summaryText).toBe( "user_1 was invited, was banned, joined, rejected their invitation, left, " + - "had their invitation withdrawn, was unbanned, was kicked, left and was kicked", + "had their invitation withdrawn, was unbanned, was removed, left and was removed", ); }); diff --git a/test/components/views/rooms/__snapshots__/RoomPreviewBar-test.tsx.snap b/test/components/views/rooms/__snapshots__/RoomPreviewBar-test.tsx.snap index 0c3a335241e..7b0e2e3f5ed 100644 --- a/test/components/views/rooms/__snapshots__/RoomPreviewBar-test.tsx.snap +++ b/test/components/views/rooms/__snapshots__/RoomPreviewBar-test.tsx.snap @@ -18,7 +18,7 @@ exports[` renders kicked message 1`] = ` class="mx_RoomPreviewBar_message" >

- You were kicked from RoomPreviewBar-test-room by @kicker:test.com + You were removed from RoomPreviewBar-test-room by @kicker:test.com

Reason: test reason @@ -58,7 +58,7 @@ exports[` with an error renders other errors 1`] = `

- Something_else was returned while trying to access the room. If you think you're seeing this message in error, please + Something_else was returned while trying to access the room. If you think you're seeing this message in error, please Date: Thu, 6 Jan 2022 10:04:50 +0000 Subject: [PATCH 2/4] Fix i18n --- src/i18n/strings/en_EN.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 69042c587d4..a3dc635010e 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -2245,7 +2245,9 @@ "was unbanned %(count)s times|other": "was unbanned %(count)s times", "was unbanned %(count)s times|one": "was unbanned", "were removed %(count)s times|other": "were removed %(count)s times", + "were removed %(count)s times|one": "were removed", "was removed %(count)s times|other": "was removed %(count)s times", + "was removed %(count)s times|one": "was removed", "%(severalUsers)schanged their name %(count)s times|other": "%(severalUsers)schanged their name %(count)s times", "%(severalUsers)schanged their name %(count)s times|one": "%(severalUsers)schanged their name", "%(oneUser)schanged their name %(count)s times|other": "%(oneUser)schanged their name %(count)s times", From 9b4ec310c2deb86a3f7080ace09d3f3b2492af05 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 6 Jan 2022 10:13:38 +0000 Subject: [PATCH 3/4] Make snapshot happy again --- .../views/rooms/__snapshots__/RoomPreviewBar-test.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/components/views/rooms/__snapshots__/RoomPreviewBar-test.tsx.snap b/test/components/views/rooms/__snapshots__/RoomPreviewBar-test.tsx.snap index 7b0e2e3f5ed..441c975f6de 100644 --- a/test/components/views/rooms/__snapshots__/RoomPreviewBar-test.tsx.snap +++ b/test/components/views/rooms/__snapshots__/RoomPreviewBar-test.tsx.snap @@ -58,7 +58,7 @@ exports[` with an error renders other errors 1`] = `

- Something_else was returned while trying to access the room. If you think you're seeing this message in error, please + Something_else was returned while trying to access the room. If you think you're seeing this message in error, please Date: Fri, 14 Jan 2022 13:00:50 +0000 Subject: [PATCH 4/4] i18n plurals --- src/i18n/strings/en_EN.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 95124d42d5f..35049c2244b 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -2257,7 +2257,9 @@ "was unbanned %(count)s times|other": "was unbanned %(count)s times", "was unbanned %(count)s times|one": "was unbanned", "were removed %(count)s times|other": "were removed %(count)s times", + "were removed %(count)s times|one": "were removed", "was removed %(count)s times|other": "was removed %(count)s times", + "was removed %(count)s times|one": "was removed", "%(severalUsers)schanged their name %(count)s times|other": "%(severalUsers)schanged their name %(count)s times", "%(severalUsers)schanged their name %(count)s times|one": "%(severalUsers)schanged their name", "%(oneUser)schanged their name %(count)s times|other": "%(oneUser)schanged their name %(count)s times",