utilitaires temporaires

This commit is contained in:
Fred Tempez 2022-10-11 10:51:10 +02:00
parent 8bf9b4c6d5
commit 17a8017a59
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,17 @@
<?php
$target = 'search';
$data = json_decode(file_get_contents('fr_FR.json'), true);
$dataTarget = json_decode(file_get_contents($target . '.json'), true);
foreach($dataTarget as $key => $value) {
if (array_key_exists($key, $data)) {
unset($dataTarget[$key]);
echo $key;
echo "<p>";
}
}
file_put_contents ($target . '.json', json_encode($dataTarget, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);

12
site/i18n/update_es.php Normal file
View File

@ -0,0 +1,12 @@
<?php
$data = json_decode(file_get_contents('fr_FR.json'), true);
$dataTarget = json_decode(file_get_contents('es.json'), true);
foreach($data as $key => $value) {
if (!array_key_exists($key, $dataTarget)) {
$dataTarget[$key] = '';
}
}
file_put_contents ('es.json', json_encode($dataTarget, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);