diff options
| author | Burt P <pburt0@gmail.com> | 2017-07-20 13:47:34 -0500 | 
|---|---|---|
| committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2017-07-22 14:24:46 -0700 | 
| commit | fd1ebbafb01bb6a5d36b7ae1666c516715efd75f (patch) | |
| tree | a4cd6c9f3cc156018064101bb509ec222c0ab39c | |
| parent | 3c83ec59b3c9a9f30ab7d694ed5b3f7e79349f9b (diff) | |
po/updatepo.sh: print stats
Signed-off-by: Burt P <pburt0@gmail.com>
| -rw-r--r-- | po/updatepo.sh | 18 | 
1 files changed, 17 insertions, 1 deletions
diff --git a/po/updatepo.sh b/po/updatepo.sh index 1825d696..cd30b4bb 100644 --- a/po/updatepo.sh +++ b/po/updatepo.sh @@ -9,6 +9,9 @@ then      exit 1  fi +MSGTOTALOLD=`msgattrib --untranslated hardinfo.pot | grep -E "^msgstr \"\"" | wc -l` +echo "hardinfo.pot has $MSGTOTALOLD strings" +  mv hardinfo.pot hardinfo.pot.old  echo "" > hardinfo.pot # empty existing file to join (-j) with  for d in hardinfo/ shell/ modules/; @@ -20,8 +23,21 @@ do      cd "$DER"  done; +MSGTOTAL=`msgattrib --untranslated hardinfo.pot | grep -E "^msgstr \"\"" | wc -l` +TDIFF=$(($MSGTOTAL - $MSGTOTALOLD)) +CHANGE="$TDIFF" +if [ $TDIFF -gt 0 ]; then CHANGE="+$TDIFF"; fi +if [ $TDIFF -eq 0 ]; then CHANGE="no change"; fi +echo "hardinfo.pot now has $MSGTOTAL strings ($CHANGE)" +  for f in *.po  do      cp "$f" "$f.old" -    msgmerge -N "$f" hardinfo.pot > tmp.po && mv tmp.po "$f" +    msgmerge -q -N "$f" hardinfo.pot > tmp.po && mv tmp.po "$f" +    UNMSG=`msgattrib --untranslated "$f" | grep -E "^msgstr \"\"" | wc -l` +    DONE=" " +    if [ $UNMSG -eq 0 ]; then +       DONE="x" +    fi +    echo "- [$DONE] $f : ($UNMSG / $MSGTOTAL remain untranslated)"  done  | 
