2 #/**********************************************************************
3 # Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 #***********************************************************************/
16 SRCDIR
="$(dirname "$0")"
27 if test "x$POFILE" != "x" ; then
28 CODE
=$
(echo "$POFILE" |
sed -e 's/.po//' -e 's,.*/,,' -e 's,.*\\,,')
29 FSTR
="$(LANG=C msgfmt --stat "$POFILE" 2>&1)"
30 if echo $FSTR |
grep translated
>/dev
/null
; then
31 TRANS
=$
(echo $FSTR |
sed 's/ translated.*//')
32 FSTR
="$(echo $FSTR | sed 's/.* translated messages*[.,]//')"
36 if echo $FSTR |
grep fuzzy
>/dev
/null
; then
37 FUZZY
=$
(echo $FSTR |
sed 's/ fuzzy.*//')
38 FSTR
="$(echo $FSTR | sed 's/.* fuzzy translations*[.,]//')"
42 if echo $FSTR |
grep untranslated
>/dev
/null
; then
43 UNTRANS
=$
(echo $FSTR |
sed 's/ untranslated.*//')
48 SUM
=$TRANS+$FUZZY+$UNTRANS
56 if test "x$1" = "x-h" ||
test "x$1" = "x--help" ; then
57 echo "Usage: $(basename $0) [domain=all]"
61 if test "x$1" != "x" && test "x$1" != "xall" ; then
64 DOMAINLIST
="freeciv nations ruledit"
67 for domain
in $DOMAINLIST
69 if test "x$1" = "x" ; then
75 dir_stats
"$SRCDIR/$domain/*.po"