From 674d7c0a5642da9317c2d5ff89f508561795d80b Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 2 Sep 2022 15:36:05 +0200 Subject: [PATCH] Embryon de fonction de lecture des dialogues --- core/class/helper.class.php | 8 ++++++++ core/class/template.class.php | 2 ++ 2 files changed, 10 insertions(+) diff --git a/core/class/helper.class.php b/core/class/helper.class.php index 756cc94d..4afc728f 100644 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -19,6 +19,14 @@ class helper { const FILTER_URL = 11; + /** + * Traduire le message dans la langue déterminée + */ + + public static function translate($text) { + $r = (array_key_exists($text, core::$dialog)) ? core::$dialog[$text] : $text; + return ($r); + } /** * Récupérer l'adresse IP sans tenir compte du proxy diff --git a/core/class/template.class.php b/core/class/template.class.php index f2784a55..3098d61b 100644 --- a/core/class/template.class.php +++ b/core/class/template.class.php @@ -439,6 +439,8 @@ class template { 'help' => '', 'id' => '' ], $attributes); + + $attributes['help'] = helper::translate($attributes['help']); $item = $attributes['href'] ? '' : ''; $item .= ''; $item .= ($attributes['href']) ? '' : '';