From 7702c81525fd1c85b1369e88de5a72ef1f812c1f Mon Sep 17 00:00:00 2001 From: marcus Date: Tue, 3 Mar 2009 15:55:54 +0000 Subject: Current language now cached per process in elgg_echo. git-svn-id: https://code.elgg.org/elgg/trunk@3039 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/languages.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engine') diff --git a/engine/lib/languages.php b/engine/lib/languages.php index 390147100..ca1711380 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -104,8 +104,10 @@ function elgg_echo($message_key, $language = "") { global $CONFIG; - - $language = get_language(); + + static $CURRENT_LANGUAGE; + if ((!$CURRENT_LANGUAGE) && (!$language)) + $CURRENT_LANGUAGE = $language = get_language(); if (isset($CONFIG->translations[$language][$message_key])) { return $CONFIG->translations[$language][$message_key]; -- cgit v1.2.3