Utilitaire de captation
This commit is contained in:
parent
eb55cb5ea4
commit
d9fb3d093e
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user