zwiicms-translations/tools/check.php

10 lines
509 B
PHP
Raw Normal View History

2022-12-29 10:42:45 +01:00
<?php
2022-12-29 10:54:05 +01:00
$langSource = 'fr_FR';
$langTarget = 'fr_FR';
$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);
2022-12-29 10:42:45 +01:00
$merge = array_merge($dif, $intersec);
2022-12-29 10:54:05 +01:00
file_put_contents('../' . $langTarget . '.json', json_encode($merge, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));