Update documentation - increase Doxygen usage
[geeqie.git] / po / gen_translations_stats.sh
1 #!/bin/bash
2
3 ## @file
4 ## @brief This script prints translations statistics for .po files
5 ## existing in the current directory
6 ##
7
8 export LC_ALL=C
9
10 echo "Translations statistics"
11 echo "Date: "$(date -R)
12 echo
13
14 echo "Note: completion % in the chart below may not be quite correct"
15 echo "      when fuzzy translations exist but do not appear in the source."
16 echo "      For exact results, run make update-po with up to date POTFILES.in."
17 echo "      comp % = trans / (trans + fuzzy + untrans)"
18 echo
19
20 (echo "Language  Comp(%) Trans Fuzzy Untrans Total"; \
21 for i in *.po; do
22         msgfmt --statistics -o /dev/null $i 2>&1 \
23         | perl -ne '
24                 my ($tr_done, $tr_fuzz, $tr_un) = (0, 0, 0);
25                 $tr_done = $1 if /(\d+) translated messages?/;
26                 $tr_fuzz = $1 if /(\d+) fuzzy translations?/;
27                 $tr_un = $1 if /(\d+) untranslated messages?/;
28                 my $tr_tot = $tr_done + $tr_fuzz + $tr_un;
29                 printf "%8.0f|%s|%7.2f|%5d|%5d|%7d|%5d\n",
30                         10000*$tr_done/$tr_tot, "'"${i%%.po}"'",
31                         100*$tr_done/$tr_tot, $tr_done, $tr_fuzz, $tr_un,
32                         $tr_tot if $tr_tot;';
33 done | sort -t '|' -b -k1,1nr -k2,2 | sed 's/^ *[0-9]*//' | tr ' |' '| '
34 ) | column -t -c 80 | tr '|' ' '
35 echo
36