Revision: 1630
http://geeqie.svn.sourceforge.net/geeqie/?rev=1630&view=rev
Author: mow
Date: 2009-04-10 10:18:42 +0000 (Fri, 10 Apr 2009)
Log Message:
-----------
Fix the broken statistic generation
The output of msgfmt has different format if no fuzzy translations (or
even no translated) are available. I fixed that by parsing the output of
msgfmt more intelligent.
Drawback of the solution is that the parsing will not work if the output
of msgfmt use not the strings "translated messages", "fuzzy
translations" and "untranslated messages".
Modified Paths:
--------------
trunk/po/gen_translations_stats.sh
Modified: trunk/po/gen_translations_stats.sh
===================================================================
--- trunk/po/gen_translations_stats.sh 2009-04-10 09:47:40 UTC (rev 1629)
+++ trunk/po/gen_translations_stats.sh 2009-04-10 10:18:42 UTC (rev 1630)
@@ -17,12 +17,16 @@
(echo "Language Comp(%) Trans Fuzzy Untrans Total"; \
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|%s|%7.2f|%5d|%5d|%7d|%5d\n",\
- ($1*100/tot)*100, "'"${i%%.po}"'", $1*100/tot,
tot-($2+$3), $2, $3, tot}' ;
+ | perl -ne '
+ my ($tr_done, $tr_fuzz, $tr_un) = (0, 0, 0);
+ $tr_done = $1 if /(\d+) translated messages/;
+ $tr_fuzz = $1 if /(\d+) fuzzy translations/;
+ $tr_un = $1 if /(\d+) untranslated messages/;
+ my $tr_tot = $tr_done + $tr_fuzz + $tr_un;
+ printf "%8.0f|%s|%7.2f|%5d|%5d|%7d|%5d\n",
+ 10000*$tr_done/$tr_tot, "'"${i%%.po}"'",
+ 100*$tr_done/$tr_tot, $tr_done, $tr_fuzz, $tr_un,
+ $tr_tot if $tr_tot;';
done | sort -t '|' -b -k1,1nr -k2,2 | sed 's/^ *[0-9]*//' | tr ' |' '| '
) | column -t -c 80 | tr '|' ' '
echo
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn