aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-09-10 10:06:33 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-09-10 10:06:33 +0000
commite8cfebe7447f031a2b20515ca985010a577ad1ed (patch)
tree2eb40c911d3db08d31318b27af1ea39dde8eee60
parent3ee4c90ed6eacf0266bbda8b35bc69bb7b57b2f4 (diff)
downloadelgg-e8cfebe7447f031a2b20515ca985010a577ad1ed.tar.gz
elgg-e8cfebe7447f031a2b20515ca985010a577ad1ed.tar.bz2
Improved language completeness algorithm.
git-svn-id: https://code.elgg.org/elgg/trunk@2069 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/languages.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/engine/lib/languages.php b/engine/lib/languages.php
index a2317f30d..528ed90e9 100644
--- a/engine/lib/languages.php
+++ b/engine/lib/languages.php
@@ -109,7 +109,7 @@
$installed[$k] = elgg_echo($k, $k);
$completeness = get_language_completeness($k);
- if ((isadminloggedin()) && ($completeness<100))//&& ($k!='en'))
+ if ((isadminloggedin()) && ($completeness<100) && ($k!='en'))
$installed[$k] .= " (" . $completeness . "% " . elgg_echo('complete') . ")";
}
@@ -127,13 +127,17 @@
$en = count($CONFIG->translations['en']);
- $lang = count($CONFIG->translations[$language]);
+ $missing = get_missing_language_keys($language);
+ if ($missing) $missing = count($missing); else $missing = 0;
+
+ //$lang = count($CONFIG->translations[$language]);
+ $lang = $en - $missing;
return round(($lang / $en) * 100, 2);
}
/**
- * Return the translation keys missing from a given language.
+ * Return the translation keys missing from a given language, or those that are identical to the english version.
*/
function get_missing_language_keys($language)
{
@@ -143,7 +147,9 @@
foreach ($CONFIG->translations['en'] as $k => $v)
{
- if (!isset($CONFIG->translations[$language][$k])) $missing[] = $k;
+ if ((!isset($CONFIG->translations[$language][$k]))
+ || ($CONFIG->translations[$language][$k] == $CONFIG->translations['en'][$k]))
+ $missing[] = $k;
}
if (count($missing))