subsurface/scripts/countTranslations.sh
Dirk Hohndel e9e72fa237 add random helper scripts
These are all kinda weird but I use them when creating releases, so it
seems to make sense to add them to the repo. I don't think they are
useful to anyone but me, but in the event someone else takes over, they
might be a useful starting point.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-02 14:24:10 -07:00

21 lines
547 B
Bash

#!/bin/bash
#
# simply create some stats
if [ ! -d translations ] && [ ! -f translations/subsurface_source.ts ] ; then
echo "please start from the Subsurface source directory"
exit 1
fi
cd translations || exit 1
STRINGS=$(grep -c source subsurface_source.ts)
for tr in subsurface_*.ts
do
[ "$tr" = "subsurface_source.ts" ] && continue
[ "$tr" = "subsurface_en_US.ts" ] && continue
MISSING=$(grep -c "translation.*unfinished" "$tr")
PERCENT=$(( (STRINGS - MISSING) * 100 / STRINGS ))
printf "%3d %s\n" "$PERCENT" "$tr"
done | sort -n -r