In the next step I merged en_EN.csv and it_IT.csv via PHP into two new files. One containing the translated Version with EN and IT in one File and the other containing all English phrases that got no translation from the it_IT.csv file.
<?php
ini_set('max_execution_time', 0);
$translatedArray = []; //translations done $noTranslationFoundArray = []; //left to translate
$enENArray = BuildArray("en_EN.csv");
$itITArray = BuildArray("it_IT.csv");
foreach ($enENArray as $enEN) {
$found = false;
if ($enEN==false) continue;
foreach ($itITArray as $itIT) {
if ($enEN[0] == $itIT[0] && $enEN[2] == $itIT[2] && $enEN[3] == $itIT[3]) {
array_push($translatedArray, $itIT);
$found = true;
break;
}
}
if(!$found){
array_push($noTranslationFoundArray,$enEN);
}
}
buildCsv($translatedArray,"translatedEnIt.csv");
buildCsv($noTranslationFoundArray,"noTranslationFound.csv");
function buildCsv($array, $filename){
$oFile = fopen($filename, "w");
foreach ($array as $element){
fputcsv($oFile, $element);
}
fclose($oFile);
}
function buildArray($fileName) {
$oFile = fopen("$fileName", "r");
$array = [];
while (!feof($oFile)) {
$array[] = fgetcsv($oFile, 0, ",");
}
fclose($oFile);
return $array;
}