1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00
RedMew/.travis/check_locale.sh
2019-03-04 14:52:52 -05:00

41 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
cd ~/build/Refactorio/RedMew/locale/ || exit
echo "Changing working directory to: "
pwd
ldiff() {
while read file; do
cat en/$file | sed 's/=.*//' | sed '/^#/ d' >diff_file.tmp
count=$(cat "$1/$file" | sed 's/=.*//' | sed '/^#/ d' | git --no-pager diff --no-index -- diff_file.tmp - | tail -n +6 | grep -o '\-.*' | sed '/^-$/d' | wc -l)
if [ "$count" -ne 0 ]; then
echo
echo "locale/$1/$file: ($count differences)"
echo "------------------------------"
cat "$1/$file" | sed 's/=.*//' | sed '/^#/ d' | git --no-pager diff --no-index -- diff_file.tmp - | tail -n +6 | grep -o '\-.*' | sed '/^-$/d' | sed 's/^-//'
echo "------------------------------"
rm diff_file.tmp
fi
done
}
echo "##############################"
echo "Checking locale for misplaced/missing keys."
for dir in *; do
if [ "$dir" != "en" ]; then
ls en | ldiff $dir
fi
done
echo
echo "Done checking locale"
echo "##############################"
cd ../../../
echo "Changing working directory back to: "
pwd