Display warning about incomplete translations
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user