2023-04-13 10:49:34 +02:00
|
|
|
<?php
|
|
|
|
$langSource = 'fr_FR';
|
|
|
|
$langTargetArray = ['de', 'en_EN', 'es', 'gr_GR', 'it', 'pt_PT', 'tr_TR'];
|
|
|
|
$folderTargetArray = ['../',
|
|
|
|
'../modules/blog/',
|
|
|
|
'../modules/news/',
|
|
|
|
'../modules/form/',
|
|
|
|
'../modules/gallery/',
|
|
|
|
'../modules/redirection/',
|
|
|
|
'../modules/search/',
|
2023-07-25 19:23:53 +02:00
|
|
|
'../modules/slider/',
|
|
|
|
'../modules/download/',
|
2023-04-13 10:49:34 +02:00
|
|
|
];
|
|
|
|
foreach($folderTargetArray as $keyFolder => $folderTarget) {
|
|
|
|
echo '<p><strong>' . $folderTarget . '</strong></p/>';
|
|
|
|
foreach ($langTargetArray as $key => $langTarget) {
|
|
|
|
if (file_exists($folderTarget . $langSource . '.json') &&
|
|
|
|
file_exists($folderTarget . $langTarget . '.json') )
|
|
|
|
{
|
2023-08-06 09:25:23 +02:00
|
|
|
$source = json_decode(file_get_contents($folderTarget . $langSource . '.json'), true, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES );
|
|
|
|
$target = json_decode(file_get_contents($folderTarget . $langTarget . '.json'), true, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
2023-04-13 10:49:34 +02:00
|
|
|
$intersec = array_intersect_key($target, $source);
|
|
|
|
$dif = array_diff_key($source, $target);
|
|
|
|
$merge = array_merge($dif, $intersec);
|
|
|
|
file_put_contents($folderTarget . $langTarget . '.json', json_encode($merge, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
|
|
|
echo '<p>' . $langTarget . ' checked.' . '</p>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo '<br />All Done';
|