annotate po/gen_translations_stats.sh @ 719:ab4162fa9209

dest_change_dir(): rewrite to use g_build_filename(), g_path_get_dirname() and g_path_get_basename().
author zas_
date Wed, 21 May 2008 09:30:53 +0000
parents 48bfa03502d3
children 163e3efc1c02
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
623
48bfa03502d3 Change translations statistics formatting to match the style
zas_
parents: 294
diff changeset
5 export LC_ALL=C
294
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
6
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
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
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
9 echo
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
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
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
18 for i in *.po; do
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
19 msgfmt --statistics -o /dev/null $i 2>&1 \
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
20 | 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
21 | awk '{ \
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
22 tot = $1 + $2 + $3; \
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
23 if (tot != 0) \
623
48bfa03502d3 Change translations statistics formatting to match the style
zas_
parents: 294
diff changeset
24 printf "%8.0f|%s|%7.2f|%5d|%5d|%7d|%5d\n",\
48bfa03502d3 Change translations statistics formatting to match the style
zas_
parents: 294
diff changeset
25 ($1*100/tot)*100, "'"${i%%.po}"'", $1*100/tot, tot-($2+$3), $2, $3, tot}' ;
48bfa03502d3 Change translations statistics formatting to match the style
zas_
parents: 294
diff changeset
26 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
27 ) | column -t -c 80 | tr '|' ' '
294
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
28 echo
9131ca4ad70b Simple helper script to display translation statistics.
zas_
parents:
diff changeset
29