2024-09-14 16:49:09 -04:00
#!/bin/sh
# This file is part of the element-web-patches.
#
# element-web-patches is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# element-web-patches is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with element-web-patches. If not, see <https://www.gnu.org/licenses/>.
echo "Renaming remove & ban..."
# Modify these to your liking
remove_command = "holocaust"
remove_command_plural = "holocausts"
remove_command_past_tense = "holocausted"
capital_remove_command = "Holocaust"
capital_remove_command_plural = "Holocausts"
capital_remove_command_past_tense = "Holocausted"
ban_command = "gas"
ban_command_plural = "gasses"
ban_command_past_tense = "gassed"
capital_ban_command = "Gas"
capital_ban_command_plural = "Gasses"
capital_ban_command_past_tense = "Gassed"
2026-02-15 17:23:19 -05:00
their = "his"
them = "him"
they = "he"
2024-09-14 16:49:09 -04:00
error( ) {
echo "Failed to rename, exiting..."
exit 1
}
# Remove
sed -i -e " s/remove/ ${ remove_command } /g " \
2026-02-15 17:23:19 -05:00
-e " s/Removes/ ${ capital_remove_command_plural } /g " " ${ 1 } " /src/slash-commands/SlashCommands.tsx
2024-09-14 16:49:09 -04:00
sed -i -e " s/\"Remove/\" ${ capital_remove_command } /g " \
2024-10-30 14:21:22 -04:00
-e " s/Failed to remove/Failed to ${ remove_command } /g " " ${ 1 } " /src/components/views/right_panel/UserInfo.tsx
2024-09-14 16:49:09 -04:00
sed -i -e " s/Removes user/ ${ capital_remove_command_plural } user/g " \
-e " s/)s removed %(tar/)s ${ remove_command_past_tense } %(tar/g " \
-e " s/\"Remove,/\" ${ capital_remove_command } ,/g " \
-e " s/You were removed/You were ${ remove_command_past_tense } /g " \
2026-02-15 17:51:57 -05:00
-e " s/Remove from room/ ${ capital_remove_command } /g " \
-e " s/Remove from space/ ${ capital_remove_command } /g " \
-e " s/Remove from %(roomName)s/ ${ capital_remove_command } from %(roomName)s/g " \
2026-02-15 17:23:19 -05:00
-e " s/\"Remove them/\" ${ capital_remove_command } ${ them } /g " \
2024-10-30 14:21:22 -04:00
-e " s/removed\"/ ${ remove_command_past_tense } \"/g " " ${ 1 } " /src/i18n/strings/en_EN.json
2024-09-14 16:49:09 -04:00
2024-10-30 14:21:22 -04:00
sed -i -e " s/senderName)s removed %(targetName/senderName)s ${ remove_command_past_tense } %(targetName/g " " ${ 1 } " /src/TextForEvent.tsx
sed -i -e " s/removed/ ${ remove_command_past_tense } /g " " ${ 1 } " /src/components/views/rooms/RoomPreviewBar.tsx
sed -i -e " s/Remove users/ ${ capital_remove_command } users/g " " ${ 1 } " /src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx
sed -i -e " s/ ${ capital_remove_command } recent/Remove recent/g " " ${ 1 } " /src/i18n/strings/en_EN.json
sed -i -e " s/ ${ capital_remove_command } recent/Remove recent/g " " ${ 1 } " /src/components/views/right_panel/UserInfo.tsx
2024-09-14 16:49:09 -04:00
# Ban
2024-10-30 14:21:22 -04:00
sed -i -e " s/\"Ban\"/\" ${ capital_ban_command } \"/g " " ${ 1 } " /src/components/views/right_panel/UserInfo.tsx || error
2024-09-14 16:49:09 -04:00
sed -i -e " s/Bans user with given id\",/ ${ capital_ban_command_plural } user with given id\",/g " \
-e " s/\"Ban from %(roomName)s\",/\" ${ capital_ban_command } from %(roomName)s\",/g " \
2026-02-15 17:23:19 -05:00
-e " s/\"Ban from room\",/\" ${ capital_ban_command } \",/g " \
-e " s/\"Ban from space\",/\" ${ capital_ban_command } \",/g " \
-e " s/\"Ban them/\" ${ capital_ban_command } ${ them } /g " \
2024-09-14 16:49:09 -04:00
-e " s/\"Ban\"/\" ${ capital_ban_command } \"/g " \
-e " s/\"Banned by %(displayName)s\",/\" ${ capital_ban_command_past_tense } by %(displayName)s\",/g " \
-e " s/\"Banned users\",/\" ${ capital_ban_command_past_tense } users\",/g " \
-e " s/was banned\",/was ${ ban_command_past_tense } \",/g " \
-e " s/was banned %(count)s times\",/was ${ ban_command_past_tense } %(count)s times\",/g " \
-e " s/were banned\",/were ${ ban_command_past_tense } \",/g " \
-e " s/banned from %(roomName)s by %(memberName)s\",/ ${ ban_command_past_tense } from %(roomName)s by %(memberName)s\",/g " \
-e " s/were banned %(count)s times\",/were ${ ban_command_past_tense } %(count)s times\",/g " \
-e " s/s banned %(targetName)s: %(reason)s\",/s ${ ban_command_past_tense } %(targetName)s: %(reason)s\",/g " \
2024-10-30 14:21:22 -04:00
-e " s/s banned %(targetName)s\",/s ${ ban_command_past_tense } %(targetName)s\",/g " " ${ 1 } " /src/i18n/strings/en_EN.json || error
2026-02-15 17:23:19 -05:00
echo "Replacing gender neutral pronouns..."
# Gender neutral pronouns
sed -i -e " s/oneUser)schanged their profile picture/oneUser)schanged ${ their } profile picture/g " \
-e " s/oneUser)schanged their name/oneUser)schanged ${ their } name/g " \
-e " s/someone using their name/someone using ${ their } name/g " \
-e " s/their display name/ ${ their } display name/g " \
-e " s/senderName)s changed their profile picture/senderName)s changed ${ their } profile picture/g " \
-e " s/senderName)s removed their profile picture/senderName)s removed ${ their } profile picture/g " \
-e " s/send them your invite link/send ${ them } your invite link/g " \
-e " s/\"Unban them/\"Unban ${ them } /g " \
-e " s/before they can be invited/before ${ they } can be invited/g " \
-e " s/until they are unbanned/until ${ they } is unbanned/g " \
-e " s/them out and prevent them from logging back in. Additionally, they will leave all the rooms they are/ ${ them } out and prevent ${ them } from logging back in. Additionally, ${ they } will leave all the rooms ${ they } is/g " \
-e " s/oneUser)shad their invitation/oneUser)shad ${ their } invitation/g " " ${ 1 } " /src/i18n/strings/en_EN.json || error