From 5c55d90be1b4e7c066d1906032aa07daa05442bc Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Mon, 2 Jan 2023 17:52:08 +0100 Subject: [PATCH] Check all in one --- tools/check.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tools/check.php b/tools/check.php index 53f8e43..f156dc4 100644 --- a/tools/check.php +++ b/tools/check.php @@ -1,10 +1,14 @@ $langTarget) { + $source = json_decode(file_get_contents('../' . $langSource . '.json'), true); + $target = json_decode(file_get_contents('../' . $langTarget . '.json'), true); + $intersec = array_intersect_key($target, $source); + $dif = array_diff_key($source, $target); + $merge = array_merge($dif, $intersec); + file_put_contents('../' . $langTarget . '.json', json_encode($merge, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)); + echo $langTarget . ' terminé.'; + } + + echo 'Tout est fini.';