3 # Removes mo files for incomplete translations
9 # How many percent needs to be translated
13 if [ ! -z "$1" ] ; then
17 echo '<?php' > libraries
/language_stats.inc.php
18 echo '/* Automatically generated file, do not edit! */' >> libraries
/language_stats.inc.php
19 echo '/* Generated by scripts/remove-incomplete-mo */' >> libraries
/language_stats.inc.php
20 echo '' >> libraries
/language_stats.inc.php
21 echo '$GLOBALS["language_stats"] = array (' >> libraries
/language_stats.inc.php
24 lang
=`echo $1 | sed 's@po/\(.*\)\.po@\1@'`
25 STATS
=`LANG=C msgfmt --statistics -o /dev/null $1 2>&1`
26 if echo $STATS |
grep -q ' translated ' ; then
27 TRANSLATED
=`echo $STATS | sed 's/\(^\|.* \)\([0-9]*\) translated.*/\2/'`
31 if echo $STATS |
grep -q ' fuzzy ' ; then
32 FUZZY
=`echo $STATS | sed 's/\(^\|.* \)\([0-9]*\) fuzzy.*/\2/'`
36 if echo $STATS |
grep -q ' untranslated ' ; then
37 UNTRANSLATED
=`echo $STATS | sed 's/\(^\|.* \)\([0-9]*\) untranslated.*/\2/'`
41 PERCENT
=`expr 100 \* $TRANSLATED / \( $TRANSLATED + $FUZZY + $UNTRANSLATED \) || true`
42 echo " '$lang' => $PERCENT," >> libraries
/language_stats.inc.php
44 if [ $PERCENT -lt $THRESHOLD ] ; then
45 echo "Removing $lang, only $PERCENT%"
46 rm -f locale
/$lang/LC_MESSAGES
/phpmyadmin.mo
54 echo ');' >> libraries
/language_stats.inc.php
55 echo '?>' >> libraries
/language_stats.inc.php