1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-25 01:05:37 +00:00
elinks/po/gen_translations_stats.sh
Kalle Olavi Niemitalo 7e8c95d934 chmod +x po/gen_translations_stats.sh
po/README suggests running the po/gen_translations_stats.sh script,
and it has a #! line, so it should be executable.
(cherry picked from elinks-0.12 commit 70ef4c8fdd)
2012-11-03 22:16:32 +02:00

22 lines
542 B
Bash
Executable File

#!/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