Simple helper script to display translation statistics.
authorLaurent Monin <geeqie@norz.org>
Wed, 9 Apr 2008 22:33:06 +0000 (22:33 +0000)
committerLaurent Monin <geeqie@norz.org>
Wed, 9 Apr 2008 22:33:06 +0000 (22:33 +0000)
po/gen_translations_stats.sh [new file with mode: 0755]

diff --git a/po/gen_translations_stats.sh b/po/gen_translations_stats.sh
new file mode 100755 (executable)
index 0000000..47183b7
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# This script prints translations statistics for .po files
+# existing in the current directory
+
+echo "Translations statistics"
+echo "Date: `date`"
+echo
+
+for i in *.po; do
+       msgfmt --statistics -o /dev/null $i 2>&1 \
+       | sed 's/^\([0-9]\+ \)[^0-9]*\([0-9]\+ \)\?[^0-9]*\([0-9]\+ \)\?[^0-9]*$/\1\2\3/g' \
+       | awk '{ \
+               tot = $1 + $2 + $3; \
+               if (tot != 0) \
+                       printf "%8.0f %8s %6.02f%% (%3d/%3d untranslated)\n",\
+                       ($1*100/tot)*100, "'"$i"'", $1*100/tot, $2+$3, tot}' ;
+done | sort -b -k1,1nr -k2,2 | sed 's/^ *[0-9]*//'
+
+echo
+