diff --git a/mkht.php b/mkht.php index ac61e7f..d80f5b6 100755 --- a/mkht.php +++ b/mkht.php @@ -80,8 +80,11 @@ foreach($nodes_src as $node) { copy($src, $target); } -if (file_exists(SITE . 'po4a.cfg')) +if (file_exists(SITE . 'po4a.cfg')) { exec('po4a --destdir ' . SITE . ' --srcdir ' . SITE . ' ' . SITE . 'po4a.cfg'); + foreach (glob('po/*.po*') as $gettext_file) // Remove annoying metadata generated by Gettext and translation tools + file_put_contents($gettext_file, preg_replace('/.*(POT-Creation-Date|PO-Revision-Date).*\n\n/sU', 'msgid ""' . LF . 'msgstr "Content-Type: text/plain; charset=UTF-8\n"' . LF . LF, file_get_contents($gettext_file))); +} $nodes_cache = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(SITE . 'cache/', RecursiveDirectoryIterator::SKIP_DOTS));