+ my $file = shift || return;
+ local $/;
+
+ open P, "< $file" || die "open(): $!";
+ my $data = readline P;
+ close P;
+
+ $data =~ /
+ ^ (
+ msgid \s "" \n
+ msgstr \s "" \n
+ (?: " [^\n]+ " \n )+
+ \n )
+ /mx;
+
+ return $1;
+}
+
+sub write_header
+{
+ my $file = shift || return;
+ my $head = shift || return;
+ local $/;
+
+ open P, "< $file" || die "open(): $!";
+ my $data = readline P;
+ close P;
+
+ $data =~ s/
+ ^ (
+ msgid \s "" \n
+ msgstr \s "" \n
+ (?: " [^\n]+ " \n )+
+ \n )
+ /$head/mx;
+
+ open P, "> $file" || die "open(): $!";
+ print P $data;
+ close P;
+}
+
+my @dirs;
+
+if( ! $source )
+{
+ @dirs = glob("./*/*/po/");
+}
+else
+{
+ @dirs = ( $source );
+}
+
+foreach my $dir (@dirs)
+{
+ if( open F, "find $dir -type f -name '$pattern' |" )