diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-09-09 00:33:50 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-09-09 00:33:50 +0000 |
commit | 75a9e7176004492c3a2b0180f05dc93a4abf3c53 (patch) | |
tree | 69f51cd603ba16c13ca0eec0e008b627e808d49d | |
parent | 98e364dd438cf6100ec76ac596331564213d0982 (diff) | |
download | elgg-75a9e7176004492c3a2b0180f05dc93a4abf3c53.tar.gz elgg-75a9e7176004492c3a2b0180f05dc93a4abf3c53.tar.bz2 |
Introducing: Admin only translation "completeness" helper.
git-svn-id: https://code.elgg.org/elgg/trunk@2064 36083f99-b078-4883-b0ff-0f9b5a30f544
-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 */ |