From af9e19a0bc4cb33fe92a3d4598efc208936b9183 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Mar 2005 19:04:39 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Les=20traductions=20peuvent=20contenir?= =?UTF-8?q?=20des=20caract=E8res=20sp=E9ciaux=20(entities).=20On=20propose?= =?UTF-8?q?=202=20fonction,=20la=20standard=20"trans"=20qui=20converti=20v?= =?UTF-8?q?ia=20htmlentities=20et=20une=20secondaire=20"transnoentities"?= =?UTF-8?q?=20pour=20les=20cas=20ou=20le=20texte=20ou=20param=E8tre=20ne?= =?UTF-8?q?=20doit=20pas=20etre=20converti.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/action/fiche.php | 12 ++++++------ htdocs/translate.class.php | 17 ++++++++++++++++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 2f8b1f95e1a..d0246304c23 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004-2005 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,10 +21,10 @@ */ /** - \file htdocs/comm/action/fiche.php - \ingroup commercial - \brief Page de la fiche action commercial - \version $Revision$ + \file htdocs/comm/action/fiche.php + \ingroup commercial + \brief Page de la fiche action commercial + \version $Revision$ */ require("./pre.inc.php"); @@ -546,7 +546,7 @@ function add_row_for_webcal_link() { print ''.$langs->trans("AddCalendarEntry").''; print ''; - print ' '.$langs->trans("ErrorWebcalLoginNotDefined","id."\">".$user->login.""); + print ' '.$langs->transnoentities("ErrorWebcalLoginNotDefined","id."\">".$user->login.""); print ''; print ''; } diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php index d4c179a6e1a..0837acc464b 100644 --- a/htdocs/translate.class.php +++ b/htdocs/translate.class.php @@ -122,9 +122,24 @@ class Translate { */ function trans($str, $param1='', $param2='', $param3='') { + return $this->transnoentities($str,htmlentities($param1),htmlentities($param2),htmlentities($param3)); + } + + /** + * \brief Retourne la version traduite du texte passé en paramètre + * Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif + * et si toujours pas trouvé, il est retourné tel quel + * \param str chaine a traduire + * \param param1 chaine de param1 + * \param param2 chaine de param1 + * \param param3 chaine de param1 + * \return string chaine traduite + */ + + function transnoentities($str, $param1='', $param2='', $param3='') { if ($this->tab_translate[$str]) { // Si la traduction est disponible - return sprintf($this->tab_translate[$str],htmlentities($param1),htmlentities($param2),htmlentities($param3)); + return sprintf($this->tab_translate[$str],$param1,$param2,$param3); } return $str; }