#!/bin/sh
# TODO: Check `set -euo pipefail` compat
# just to fix kick
sed -i -e 's/remove/holocaust/g' \
	-e 's/Removes/Holocausts/g' ../node_modules/matrix-react-sdk/src/SlashCommands.tsx
sed -i -e 's/senderName)s removed %(targetName/senderName)s holocausted %(targetName/g' ../node_modules/matrix-react-sdk/src/TextForEvent.tsx
sed -i -e 's/"Remove/"Holocaust/g' \
	-e 's/Failed to remove/Failed to holocaust/g' ../node_modules/matrix-react-sdk/src/components/views/right_panel/UserInfo.tsx
sed -i -e 's/removed/holocausted/g' ../node_modules/matrix-react-sdk/src/components/views/rooms/RoomPreviewBar.tsx
sed -i -e 's/Remove users/Holocaust users/g' ../node_modules/matrix-react-sdk/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx

sed -i -e 's/Removes user/Holocausts user/g' \
	-e 's/)s removed %(tar/)s holocausted %(tar/g' \
	-e 's/"Remove,/"Holocaust,/g' \
	-e 's/You were removed/You were holocausted/g' \
	-e 's/Remove from/Holocaust from/g' \
	-e 's/removed %(count)s times"/holocausted %(count)s times"/g' \
	-e 's/removed"/holocausted"/g' \
	-e 's/"Remove recent messages"/"Holocaust recent messages"/g' ../node_modules/matrix-react-sdk/src/i18n/strings/en_EN.json

sed -i -e 's/removes/holocausts/g' ../node_modules/matrix-react-sdk/src/settings/Settings.tsx
sed -i -e 's/Remove/Holocaust/g' ../node_modules/matrix-react-sdk/src/widgets/CapabilityText.tsx

# replace ban messages
sed -i -e 's/"Ban"/"Gas"/g' ../node_modules/matrix-react-sdk/src/components/views/right_panel/UserInfo.tsx

sed -i -e 's/Bans user with given id",/Gasses user with given id",/g' \
	-e 's/"Ban from %(roomName)s",/"Gas from %(roomName)s",/g' \
	-e 's/"Ban"/"Gas"/g' \
	-e 's/"Banned by %(displayName)s",/"Gassed by %(displayName)s",/g' \
	-e 's/"Banned users",/"Gassed users",/g' \
	-e 's/was banned",/was gassed",/g' \
	-e 's/was banned %(count)s times",/was gassed %(count)s times",/g' \
	-e 's/were banned",/were gassed",/g' \
	-e 's/banned from %(roomName)s by %(memberName)s",/gassed from %(roomName)s by %(memberName)s",/g' \
	-e 's/were banned %(count)s times",/were gassed %(count)s times",/g' \
	-e 's/s banned %(targetName)s: %(reason)s",/s gassed %(targetName)s: %(reason)s",/g' \
	-e 's/s banned %(targetName)s",/s gassed %(targetName)s",/g' ../node_modules/matrix-react-sdk/src/i18n/strings/en_EN.json
