diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/languages.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/engine/lib/languages.php b/engine/lib/languages.php index 1e2714d77..93ea5d09b 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -105,10 +105,31 @@ $installed = array(); foreach ($CONFIG->translations as $k => $v) + { $installed[$k] = elgg_echo($k, $k); + + if ((isadminloggedin()) && ($k!='en')) + $installed[$k] .= " (" . get_language_completeness($k) . "% " . elgg_echo('complete') . ")"; + } return $installed; } + + /** + * Return the level of completeness for a given language code (compared to english) + */ + function get_language_completeness($language) + { + global $CONFIG; + + $language = sanitise_string($language); + + $en = count($CONFIG->translations['en']); + + $lang = count($CONFIG->translations[$language]); + + return round(($lang / $en) * 100, 2); + } register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/");
|