Display warning about incomplete translations

This commit is contained in:
Michal Čihař
2011-04-05 15:28:02 +02:00
parent ef48add94c
commit 26a4a09c11
5 changed files with 37 additions and 0 deletions

View File

@@ -14,6 +14,12 @@ if [ ! -z "$1" ] ; then
THRESHOLD=$1
fi
echo '<?php' > libraries/language_stats.inc.php
echo '/* Automatically generated file, do not edit! */' >> libraries/language_stats.inc.php
echo '/* Generated bt scripts/remove-incomplete-mo */' >> libraries/language_stats.inc.php
echo '' >> libraries/language_stats.inc.php
echo '$GLOBALS["language_stats"] = array (' >> libraries/language_stats.inc.php
check() {
lang=`echo $1 | sed 's@po/\(.*\)\.po@\1@'`
STATS=`LANG=C msgfmt --statistics -o /dev/null $1 2>&1`
@@ -33,6 +39,7 @@ check() {
UNTRANSLATED=0
fi
PERCENT=`expr 100 \* $TRANSLATED / \( $TRANSLATED + $FUZZY + $UNTRANSLATED \) || true`
echo " '$lang' => $PERCENT," >> libraries/language_stats.inc.php
if [ $PERCENT -lt $THRESHOLD ] ; then
echo "Removing $lang, only $PERCENT%"
@@ -44,3 +51,5 @@ for x in po/*.po ; do
check $x
done
echo ');' >> libraries/language_stats.inc.php
echo '?>' >> libraries/language_stats.inc.php