Sort deleted and inserted messages, so that adjacent may possibly be

printed next to each other. To test, try e.g.
        "diff_po.pl -r39000:39100 sk.po"


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39246 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Kornel Benko 2011-07-05 17:10:07 +00:00
parent 6c23b48fec
commit e2997ca1b8

View File

@ -146,26 +146,48 @@ sub diff_po($$)
} }
} }
@MsgKeys = &getLineSortedKeys(\%Messages); if (1) {
for my $k (@MsgKeys) { @MsgKeys = sort keys %Messages, keys %newMessages;
$result |= 8; for my $k (@MsgKeys) {
print "deleted message\n"; if (defined($Messages{$k})) {
print "< line = " . $Messages{$k}->{line} . "\n" if ($printlines); $result |= 8;
print RED "< fuzzy = " . $Messages{$k}->{fuzzy} . "\n", RESET; print "deleted message\n";
print RED "< msgid = \"$k\"\n", RESET; print "< line = " . $Messages{$k}->{line} . "\n" if ($printlines);
print RED "< msgstr = \"" . $Messages{$k}->{msgstr} . "\"\n", RESET; print RED "< fuzzy = " . $Messages{$k}->{fuzzy} . "\n", RESET;
print RED "< msgid = \"$k\"\n", RESET;
print RED "< msgstr = \"" . $Messages{$k}->{msgstr} . "\"\n", RESET;
}
if (defined($newMessages{$k})) {
$result |= 16;
print "new message\n";
print "> line = " . $newMessages{$k}->{line} . "\n" if ($printlines);
print GREEN "> fuzzy = " . $newMessages{$k}->{fuzzy} . "\n", RESET;
print GREEN "> msgid = \"$k\"\n", RESET;
print GREEN "> msgstr = \"" . $newMessages{$k}->{msgstr} . "\"\n", RESET;
}
}
} }
else {
@MsgKeys = &getLineSortedKeys(\%Messages);
for my $k (@MsgKeys) {
$result |= 8;
print "deleted message\n";
print "< line = " . $Messages{$k}->{line} . "\n" if ($printlines);
print RED "< fuzzy = " . $Messages{$k}->{fuzzy} . "\n", RESET;
print RED "< msgid = \"$k\"\n", RESET;
print RED "< msgstr = \"" . $Messages{$k}->{msgstr} . "\"\n", RESET;
}
@MsgKeys = &getLineSortedKeys(\%newMessages); @MsgKeys = &getLineSortedKeys(\%newMessages);
for my $k (@MsgKeys) { for my $k (@MsgKeys) {
$result |= 16; $result |= 16;
print "new message\n"; print "new message\n";
print "> line = " . $newMessages{$k}->{line} . "\n" if ($printlines); print "> line = " . $newMessages{$k}->{line} . "\n" if ($printlines);
print GREEN "> fuzzy = " . $newMessages{$k}->{fuzzy} . "\n", RESET; print GREEN "> fuzzy = " . $newMessages{$k}->{fuzzy} . "\n", RESET;
print GREEN "> msgid = \"$k\"\n", RESET; print GREEN "> msgid = \"$k\"\n", RESET;
print GREEN "> msgstr = \"" . $newMessages{$k}->{msgstr} . "\"\n", RESET; print GREEN "> msgstr = \"" . $newMessages{$k}->{msgstr} . "\"\n", RESET;
}
} }
&printExtraMessages("fuzzy", \%Fuzzy); &printExtraMessages("fuzzy", \%Fuzzy);
&printExtraMessages("untranslated", \%Untranslated); &printExtraMessages("untranslated", \%Untranslated);
} }