From 0572a82a9163323088ef93f9703326b94a9dfad4 Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 1 Feb 2010 19:45:55 +0000 Subject: Fixes #1166. get_installed_translations() only calculates completion if admin is logge din. git-svn-id: http://code.elgg.org/elgg/trunk@3893 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/languages.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/languages.php b/engine/lib/languages.php index 35f406de8..98283f141 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -100,7 +100,7 @@ function elgg_echo($message_key, $language = "") { if (!$language) { $language = $CURRENT_LANGUAGE; } - + if (isset($CONFIG->translations[$language][$message_key])) { return $CONFIG->translations[$language][$message_key]; } else if (isset($CONFIG->translations["en"][$message_key])) { @@ -179,10 +179,11 @@ function get_installed_translations() { foreach ($CONFIG->translations as $k => $v) { $installed[$k] = elgg_echo($k, $k); - - $completeness = get_language_completeness($k); - if ((isadminloggedin()) && ($completeness<100) && ($k!='en')) { - $installed[$k] .= " (" . $completeness . "% " . elgg_echo('complete') . ")"; + if (isadminloggedin()) { + $completeness = get_language_completeness($k); + if (($completeness < 100) && ($k != 'en')) { + $installed[$k] .= " (" . $completeness . "% " . elgg_echo('complete') . ")"; + } } } @@ -240,4 +241,4 @@ function get_missing_language_keys($language) { return false; } -register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/"); \ No newline at end of file +register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/"); -- cgit v1.2.3