diff options
-rw-r--r-- | engine/lib/languages.php | 21 | ||||
-rw-r--r-- | languages/en.php | 2 |
2 files changed, 23 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/");
diff --git a/languages/en.php b/languages/en.php index b48fa3e6c..a435eac6c 100644 --- a/languages/en.php +++ b/languages/en.php @@ -535,6 +535,7 @@ To remove a widget drag it back to the <b>Widget gallery</b>.", 'enable' => "Enable", 'disable' => "Disable", 'request' => "Request", + 'complete' => "Complete", 'invite' => "Invite", @@ -557,6 +558,7 @@ To remove a widget drag it back to the <b>Widget gallery</b>.", 'link:text' => 'view link', + /** * Generic data words */ |