Mercurial > geeqie.yaz
annotate po/gen_translations_stats.sh @ 1680:bc42d0f9cee7
update column sizes after toggling thumbnails
author | nadvornik |
---|---|
date | Fri, 24 Jul 2009 14:07:54 +0000 |
parents | 1310d504b548 |
children |
rev | line source |
---|---|
294 | 1 #!/bin/bash |
2 | |
3 # This script prints translations statistics for .po files | |
4 # existing in the current directory | |
623
48bfa03502d3
Change translations statistics formatting to match the style
zas_
parents:
294
diff
changeset
|
5 export LC_ALL=C |
294 | 6 |
7 echo "Translations statistics" | |
623
48bfa03502d3
Change translations statistics formatting to match the style
zas_
parents:
294
diff
changeset
|
8 echo "Date: "$(date -R) |
294 | 9 echo |
10 | |
623
48bfa03502d3
Change translations statistics formatting to match the style
zas_
parents:
294
diff
changeset
|
11 echo "Note: completion % in the chart below may not be quite correct" |
48bfa03502d3
Change translations statistics formatting to match the style
zas_
parents:
294
diff
changeset
|
12 echo " when fuzzy translations exist but do not appear in the source." |
48bfa03502d3
Change translations statistics formatting to match the style
zas_
parents:
294
diff
changeset
|
13 echo " For exact results, run make update-po with up to date POTFILES.in." |
48bfa03502d3
Change translations statistics formatting to match the style
zas_
parents:
294
diff
changeset
|
14 echo " comp % = trans / (trans + fuzzy + untrans)" |
48bfa03502d3
Change translations statistics formatting to match the style
zas_
parents:
294
diff
changeset
|
15 echo |
48bfa03502d3
Change translations statistics formatting to match the style
zas_
parents:
294
diff
changeset
|
16 |
48bfa03502d3
Change translations statistics formatting to match the style
zas_
parents:
294
diff
changeset
|
17 (echo "Language Comp(%) Trans Fuzzy Untrans Total"; \ |
294 | 18 for i in *.po; do |
19 msgfmt --statistics -o /dev/null $i 2>&1 \ | |
1534 | 20 | perl -ne ' |
21 my ($tr_done, $tr_fuzz, $tr_un) = (0, 0, 0); | |
1541 | 22 $tr_done = $1 if /(\d+) translated messages?/; |
23 $tr_fuzz = $1 if /(\d+) fuzzy translations?/; | |
24 $tr_un = $1 if /(\d+) untranslated messages?/; | |
1534 | 25 my $tr_tot = $tr_done + $tr_fuzz + $tr_un; |
26 printf "%8.0f|%s|%7.2f|%5d|%5d|%7d|%5d\n", | |
27 10000*$tr_done/$tr_tot, "'"${i%%.po}"'", | |
28 100*$tr_done/$tr_tot, $tr_done, $tr_fuzz, $tr_un, | |
29 $tr_tot if $tr_tot;'; | |
623
48bfa03502d3
Change translations statistics formatting to match the style
zas_
parents:
294
diff
changeset
|
30 done | sort -t '|' -b -k1,1nr -k2,2 | sed 's/^ *[0-9]*//' | tr ' |' '| ' |
48bfa03502d3
Change translations statistics formatting to match the style
zas_
parents:
294
diff
changeset
|
31 ) | column -t -c 80 | tr '|' ' ' |
294 | 32 echo |
33 |