From a6e66a3a69619dae83f35f63dcd0f1ad8ca6b4b4 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Tue, 31 Mar 2009 12:49:01 +0000 Subject: [PATCH] =?UTF-8?q?-=20Function=20tr()=20:=20Correction=20de=20la?= =?UTF-8?q?=20mani=C3=A8re=20de=20faire.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/includes/functions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trunk/includes/functions.php b/trunk/includes/functions.php index 71af4f28..f499295c 100644 --- a/trunk/includes/functions.php +++ b/trunk/includes/functions.php @@ -430,13 +430,13 @@ function LSdebugDefined() { } function tr($msg,$key=null) { - $val = $GLOBALS['Smarty']->get_template_vars($msg); - if (!$val) - $val=$msg; - if (is_array($val)) { - echo __($val[$key]); + if (is_array($msg)) { + echo __($msg[$key]); } else { + $val = $GLOBALS['Smarty']->get_template_vars($msg); + if (!$val) + $val=$msg; echo __($val); } }