Utilitaire de captation

This commit is contained in:
Fred Tempez 2022-09-03 09:09:05 +02:00
parent eb55cb5ea4
commit d9fb3d093e

View File

@ -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);
}