Files

23 lines
629 B
Bash
Raw Permalink Normal View History

#!/bin/sh
# this script runs in alpine image which only has `sh` shell
if [ ! -f ./options/locale/locale_en-US.json ]; then
echo "please run this script in the root directory of the project"
exit 1
fi
2020-01-21 17:26:17 +01:00
mv ./options/locale/locale_en-US.json ./options/
2020-01-21 17:26:17 +01:00
# Remove translation under 25% of en_us
2025-12-25 12:51:33 -08:00
baselines=$(cat "./options/locale_en-US.json" | wc -l)
2020-01-21 17:26:17 +01:00
baselines=$((baselines / 4))
for filename in ./options/locale/*.json; do
2025-12-25 12:51:33 -08:00
lines=$(cat "$filename" | wc -l)
if [ "$lines" -lt "$baselines" ]; then
2020-01-21 17:26:17 +01:00
echo "Removing $filename: $lines/$baselines"
rm "$filename"
fi
done
mv ./options/locale_en-US.json ./options/locale/