diff --git a/Documentation.html b/Documentation.html
index af3c44bd8..baa3d1e8c 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -624,6 +624,9 @@ since this link provides funding for phpMyAdmin.
You can set this parameter to TRUE to stop this message
from appearing.
+
$cfg['TranslationWarningThreshold'] integer
+ Show warning about incomplete translations on certain threshold.
+
$cfg['AllowThirdPartyFraming'] boolean
Setting this to true allows a page located on a different
domain to call phpMyAdmin inside a frame, and is a potential security
diff --git a/libraries/.gitignore b/libraries/.gitignore
new file mode 100644
index 000000000..ea4a1fdaf
--- /dev/null
+++ b/libraries/.gitignore
@@ -0,0 +1 @@
+language_stats.inc.php
diff --git a/libraries/config.default.php b/libraries/config.default.php
index d47b705bd..4ca31e78f 100644
--- a/libraries/config.default.php
+++ b/libraries/config.default.php
@@ -61,6 +61,13 @@ $cfg['SuhosinDisableWarning'] = false;
*/
$cfg['McryptDisableWarning'] = false;
+/**
+ * Show warning about incomplete translations on certain threshold.
+ *
+ * @global boolean $cfg['TranslationWarningThreshold']
+ */
+$cfg['TranslationWarningThreshold'] = 80;
+
/**
* Allows phpMyAdmin to be included from a document located on
* another domain; setting this to true is a potential security hole
diff --git a/main.php b/main.php
index 431f65b87..7a912429f 100644
--- a/main.php
+++ b/main.php
@@ -354,6 +354,23 @@ if ($cfg['SuhosinDisableWarning'] == false && @ini_get('suhosin.request.max_valu
trigger_error(PMA_sanitize(sprintf(__('Server running with Suhosin. Please refer to %sdocumentation%s for possible issues.'), '[a@./Documentation.html#faq1_38@_blank]', '[/a]')), E_USER_WARNING);
}
+/**
+ * Warning about incomplete translations.
+ *
+ * The data file is created while creating release by ./scripts/remove-incomplete-mo
+ */
+if (file_exists('./libraries/language_stats.inc.php')) {
+ include('./libraries/language_stats.inc.php');
+ /*
+ * This message is intentionally not translated, because we're
+ * handling incomplete translations here and focus on english
+ * speaking users.
+ */
+ if (isset($GLOBALS['language_stats'][$lang]) && $GLOBALS['language_stats'][$lang] < $cfg['TranslationWarningThreshold']) {
+ trigger_error('You are using translation which is not complete, you are welcome to contribute to it.', E_USER_NOTICE);
+ }
+}
+
/**
* prints list item for main page
*
diff --git a/scripts/remove-incomplete-mo b/scripts/remove-incomplete-mo
index 65b5ad488..a9ff4eb94 100755
--- a/scripts/remove-incomplete-mo
+++ b/scripts/remove-incomplete-mo
@@ -14,6 +14,12 @@ if [ ! -z "$1" ] ; then
THRESHOLD=$1
fi
+echo ' 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