294
|
1 #!/bin/bash
|
|
2
|
|
3 # This script prints translations statistics for .po files
|
|
4 # existing in the current directory
|
|
5
|
|
6 echo "Translations statistics"
|
|
7 echo "Date: `date`"
|
|
8 echo
|
|
9
|
|
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]*//'
|
|
19
|
|
20 echo
|
|
21
|