miniflux-legacy/scripts/sync-locales.php
2014-07-23 07:43:48 -03:00

27 lines
771 B
PHP
Executable File

#!/usr/bin/env php
<?php
$reference_file = $argv[1];
$outdated_file = $argv[2];
$reference = include $reference_file;
$outdated = include $outdated_file;
$output = '<?php'.PHP_EOL.PHP_EOL;
$output .= 'return array('.PHP_EOL;
foreach ($reference as $key => $value) {
if (isset($outdated[$key])) {
//$output .= " '".str_replace("'", "\'", $key)."' => '".str_replace("'", "\'", $value)."',\n";
$output .= " '".str_replace("'", "\'", $key)."' => '".str_replace("'", "\'", $outdated[$key])."',\n";
}
else {
//$output .= " // '".str_replace("'", "\'", $key)."' => '".str_replace("'", "\'", $value)."',\n";
$output .= " // '".str_replace("'", "\'", $key)."' => '',\n";
}
}
$output .= ');'.PHP_EOL;
echo $output;