From 5ae29540d7e09bed04d01f976e94fa9e94cb9ff4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Feb 2005 21:32:46 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20fonction=20transcountry=20pour=20tradui?= =?UTF-8?q?re=20un=20libell=E9=20dont=20la=20valeur=20d=E9pend=20d'un=20pa?= =?UTF-8?q?ys=20en=20plus=20de=20la=20langue.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/translate.class.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php index b861035a6a3..17c280a83f9 100644 --- a/htdocs/translate.class.php +++ b/htdocs/translate.class.php @@ -114,8 +114,7 @@ class Translate { * \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 - * [en] Return translated version of parameter string - * \param str original string to translate + * \param str chaine a traduire * \param param1 chaine de param1 * \param param2 chaine de param1 * \param param3 chaine de param1 @@ -130,6 +129,19 @@ class Translate { return $str; } + /** + * \brief Retourne la version traduite du texte passé en paramètre complété du code pays + * \param str chaine a traduire + * \param country_code code pays (FR, ...) + * \return string chaine traduite + */ + + function transcountry($str, $countrycode) { + if ($this->tab_translate["$str$countrycode"]) return $this->trans("$str$countrycode"); + else return $this->trans("$str"); + } + + /** * \brief Retourne la liste des langues disponibles * \return array list of languages