#!/usr/bin/perl -w
use strict;

$/ = "\n\n";
$_ = <>;
s/^"X-Launchpad-Export-Date: .*\\n"\n//m;
s/^"X-Generator: Launchpad \(build \d+\)\\n"\n//m;
s/^("PO(?:-Revision|T-Creation)-Date: \d+-\d+-\d+ \d+:\d+)(.*)$/$1:00 $2/mg;
print;

$/ = undef;
$_ = <>;
s/"\n"//g;
s/^(#\.)\s+$/$1/mg;
# Fix transifex source refs
while (s/(^#: .*) /$1\n#: /m) { }
print;
