From 03744381414aa6b25fed416a7456a818c1a69ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 29 Dec 2018 11:46:51 +0000 Subject: [PATCH] Add an option to generate statistics for core domains only. --- statistics | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/statistics b/statistics index bc374e7..b0b986c 100755 --- a/statistics +++ b/statistics @@ -23,6 +23,13 @@ ODD_CHARS='�' CL=0 # counter for css style STATUS="OK" # Total status of translations +while getopts ":c" opt; do + case $opt in + c) + CORE_TEXTDOMAINS="wesnoth lib editor help ai units multiplayer anl tutorial" ;; + esac +done + for BRANCH in $BRANCHES; do echo -e "Repository: $BLUE$BRANCH"$ENDCOLOR STATSFILE="statistics-$BRANCH.html" @@ -83,7 +90,12 @@ $(LC_TIME="en_US.UTF-8" date) Graph " >> $STATSFILE - for files in $BRANCH/*.po; do + if [ -n "$CORE_TEXTDOMAINS" ]; then + POFILES=$BRANCH/$(echo $CORE_TEXTDOMAINS | awk '$NF=$NF "*.po"' OFS="*.po $BRANCH/") + else + POFILES="$BRANCH/*.po" + fi + for files in $POFILES; do file=$(basename $files) filename=$(basename $file .po) npo=$(($npo + 1)); has_errors="no"; has_warnings="no";