From d9fb3d093e8ecf7180bd2dfe0537d8d759c71f7b Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 3 Sep 2022 09:09:05 +0200 Subject: [PATCH] Utilitaire de captation --- core/class/helper.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/class/helper.class.php b/core/class/helper.class.php index 4afc728f..1ee31d59 100644 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -25,6 +25,17 @@ class helper { public static function translate($text) { $r = (array_key_exists($text, core::$dialog)) ? core::$dialog[$text] : $text; + // Captation + $data = json_decode(file_get_contents('site/i18n/template.json'), true); + if (!array_key_exists($text, $data) + && !empty($text) + && !strpos($text, 'span') + ) { + $data [] = [ + $text => '' + ]; + file_put_contents ('site/i18n/template.json', json_encode($data, JSON_UNESCAPED_UNICODE), LOCK_EX); + } return ($r); }