annotate po/gen_translations_stats.sh @ 582:8f696e43873d

Fix two memory leaks.
author zas_
date Mon, 05 May 2008 08:15:52 +0000
parents 9131ca4ad70b
children 48bfa03502d3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
294
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
1 #!/bin/bash
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
2
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
3 # This script prints translations statistics for .po files
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
4 # existing in the current directory
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
5
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
6 echo "Translations statistics"
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
7 echo "Date: `date`"
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
8 echo
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
9
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
10 for i in *.po; do
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
11 msgfmt --statistics -o /dev/null $i 2>&1 \
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
12 | sed 's/^\([0-9]\+ \)[^0-9]*\([0-9]\+ \)\?[^0-9]*\([0-9]\+ \)\?[^0-9]*$/\1\2\3/g' \
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
13 | awk '{ \
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
14 tot = $1 + $2 + $3; \
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
15 if (tot != 0) \
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
16 printf "%8.0f %8s %6.02f%% (%3d/%3d untranslated)\n",\
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
17 ($1*100/tot)*100, "'"$i"'", $1*100/tot, $2+$3, tot}' ;
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
18 done | sort -b -k1,1nr -k2,2 | sed 's/^ *[0-9]*//'
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
19
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
20 echo
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
21