2020-01-21 17:26:17 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
mv ./options/locale/locale_en-US.ini ./options/
|
2020-01-25 07:19:35 +01:00
|
|
|
|
|
|
|
# Make sure to only change lines that have the translation enclosed between quotes
|
2020-01-25 15:49:47 +01:00
|
|
|
sed -i -r -e '/^[a-zA-Z0-9_.-]+[ ]*=[ ]*".*"$/ {
|
|
|
|
s/^([a-zA-Z0-9_.-]+)[ ]*="/\1=/
|
2020-01-25 07:19:35 +01:00
|
|
|
s/\\"/"/g
|
|
|
|
s/"$//
|
|
|
|
}' ./options/locale/*.ini
|
2020-01-21 17:26:17 +01:00
|
|
|
|
|
|
|
# Remove translation under 25% of en_us
|
2020-11-28 07:12:22 +01:00
|
|
|
baselines=$(wc -l "./options/locale_en-US.ini" | cut -d" " -f1)
|
2020-01-21 17:26:17 +01:00
|
|
|
baselines=$((baselines / 4))
|
|
|
|
for filename in ./options/locale/*.ini; do
|
2020-11-28 07:12:22 +01:00
|
|
|
lines=$(wc -l "$filename" | cut -d" " -f1)
|
2020-01-21 17:26:17 +01:00
|
|
|
if [ $lines -lt $baselines ]; then
|
|
|
|
echo "Removing $filename: $lines/$baselines"
|
|
|
|
rm "$filename"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
mv ./options/locale_en-US.ini ./options/locale/
|