strip annoying gettext metadata

This commit is contained in:
Miraty 2024-09-29 22:13:43 +02:00
parent 1b4848ef58
commit 1d69235973

View file

@ -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));