Include <sys/types.h> and fix compilation on an old PPC/Debian system
[elinks/images.git] / po / gen_translations_stats.sh
blob47183b71aff681481a30c5ff98d80b7a8fb0c21e
1 #!/bin/bash
3 # This script prints translations statistics for .po files
4 # existing in the current directory
6 echo "Translations statistics"
7 echo "Date: `date`"
8 echo
10 for i in *.po; do
11 msgfmt --statistics -o /dev/null $i 2>&1 \
12 | sed 's/^\([0-9]\+ \)[^0-9]*\([0-9]\+ \)\?[^0-9]*\([0-9]\+ \)\?[^0-9]*$/\1\2\3/g' \
13 | awk '{ \
14 tot = $1 + $2 + $3; \
15 if (tot != 0) \
16 printf "%8.0f %8s %6.02f%% (%3d/%3d untranslated)\n",\
17 ($1*100/tot)*100, "'"$i"'", $1*100/tot, $2+$3, tot}' ;
18 done | sort -b -k1,1nr -k2,2 | sed 's/^ *[0-9]*//'
20 echo