diff --git a/core/class/helper.class.php b/core/class/helper.class.php index dc8c92fe..28434aa6 100644 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -29,12 +29,16 @@ class helper $target = 'blog'; /** Collecte des dialogues des modules */ $url = $_SERVER['QUERY_STRING']; - $module = explode('/', $url); - if ($module === $target) - { - $dialogues = json_decode(file_get_contents('module/' . $target . '/i18n/fr_FR.json' ), true); - $data = array_merge($dialogues,[$text => '']); - file_put_contents ('module/' . $target . '/i18n/fr_FR.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX); + $module = explode('/', $url); + if ( $module[0] === $target) + { + // La traduction existe déjà dans le core + if (array_key_exists($text, core::$dialog) === false && !empty($text)) { + $dialogues = json_decode(file_get_contents('module/' . $target . '/i18n/fr_FR.json' ), true); + $data = array_merge($dialogues,[$text => '']); + file_put_contents ('module/' . $target . '/i18n/fr_FR.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX); + } + } return (array_key_exists($text, core::$dialog) && !empty(core::$dialog[$text]) ? core::$dialog[$text] : $text); }