Check all in one

This commit is contained in:
Fred Tempez 2023-01-02 17:52:08 +01:00
parent 1fdfdfc6f5
commit 5c55d90be1

View File

@ -1,10 +1,14 @@
<?php <?php
$langSource = 'fr_FR'; $langSource = 'fr_FR';
$langTarget = 'fr_FR'; $langTargetArray = ['en_EN', 'es','gr_GR', 'it', 'pt_PT'];
$source = json_decode(file_get_contents('../' . $langSource . '.json'), true); foreach ($langTargetArray as $key => $langTarget) {
$target = json_decode(file_get_contents('../' . $langTarget . '.json'), true); $source = json_decode(file_get_contents('../' . $langSource . '.json'), true);
$intersec = array_intersect_key($target, $source); $target = json_decode(file_get_contents('../' . $langTarget . '.json'), true);
$dif = array_diff_key($source, $target); $intersec = array_intersect_key($target, $source);
$merge = array_merge($dif, $intersec); $dif = array_diff_key($source, $target);
file_put_contents('../' . $langTarget . '.json', json_encode($merge, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)); $merge = array_merge($dif, $intersec);
echo 'Done...'; file_put_contents('../' . $langTarget . '.json', json_encode($merge, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
echo $langTarget . ' terminé.';
}
echo 'Tout est fini.';