2020-07-25 11:02:44 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
mydir="$(dirname "$(realpath "$0")")"
|
|
|
|
|
2020-08-22 12:26:22 +03:00
|
|
|
pushd "$mydir" > /dev/null
|
|
|
|
|
|
|
|
# Require clean git state
|
|
|
|
uncommitted=`git status --porcelain`
|
|
|
|
if [ ! -z "$uncommitted" ]; then
|
|
|
|
echo "Uncommitted changes are present, please commit first!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
mydir="."
|
|
|
|
|
2020-08-22 11:51:45 +03:00
|
|
|
# Element -> SchildiChat
|
2020-07-25 11:02:44 +03:00
|
|
|
find "$mydir/vector/src/main/res" -name strings.xml -exec \
|
|
|
|
sed -i 's|Element|SchildiChat|g' '{}' \;
|
2020-08-22 11:51:45 +03:00
|
|
|
# Restore Element where it makes sense
|
2020-07-25 11:02:44 +03:00
|
|
|
find "$mydir/vector/src/main/res" -name strings.xml -exec \
|
2020-08-22 11:51:45 +03:00
|
|
|
sed -i 's/SchildiChat \(Web\|iOS\|Desktop\)/Element \1/g' '{}' \;
|
2020-07-25 11:02:44 +03:00
|
|
|
find "$mydir/vector/src/main/res" -name strings.xml -exec \
|
2020-08-22 11:51:45 +03:00
|
|
|
sed -i 's|SchildiChat Matrix Services|Element Matrix Services|g' '{}' \;
|
2020-07-25 11:02:44 +03:00
|
|
|
find "$mydir/vector/src/main/res" -name strings.xml -exec \
|
|
|
|
sed -i 's|\("use_latest_riot">.*\)SchildiChat\(.*</string>\)|\1Element\2|g' '{}' \;
|
2020-08-22 11:51:45 +03:00
|
|
|
find "$mydir/vector/src/main/res" -name strings.xml -exec \
|
|
|
|
sed -i 's|\("use_other_session_content_description">.*\)SchildiChat\(.*SchildiChat.*</string>\)|\1SchildiChat/Element\2|' '{}' \;
|
2020-07-25 11:02:44 +03:00
|
|
|
|
|
|
|
# Requires manual intervention for correct grammar
|
|
|
|
sed -i 's|!nnen|wolpertinger|g' "$mydir/vector/src/main/res/values-de/strings.xml"
|
|
|
|
sed -i 's|!n|schlumpfwesen|g' "$mydir/vector/src/main/res/values-de/strings.xml"
|
2020-08-22 12:26:22 +03:00
|
|
|
|
2020-08-22 12:32:28 +03:00
|
|
|
# Remove Triple-T stuff to avoid using them in F-Droid
|
|
|
|
rm -rf "$mydir/vector/src/main/play/listings"
|
|
|
|
|
2020-08-22 12:26:22 +03:00
|
|
|
git add -A
|
|
|
|
git commit -m "Automatic SchildiChat string correction"
|
|
|
|
|
|
|
|
popd > /dev/null
|
2020-08-24 16:28:37 +03:00
|
|
|
|
|
|
|
mydir="$(dirname "$(realpath "$0")")"
|
|
|
|
echo -e "\033[1;33m""Please fix -schlumpfwesen and -wolpertinger cases manually!""\033[0m"
|
|
|
|
echo "- $mydir/vector/src/main/res/values-de/strings.xml"
|