Skip to content

Commit 840ad54

Browse files
committed
tools/xci2po.pl: preserve order
Perl randomizes the order when iterating a hash. This commit attempts to keep the diffs of POT/PO update commits small and readable.
1 parent 5cfbc51 commit 840ad54

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tools/xci2po.pl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22

33
use strict;
44

5+
my @list;
56
my %msges;
67

78
sub add_message($$$) {
89
my ($msg, $filename, $line) = @_;
9-
$msges{$msg} .= "#: $filename:$line\n";
10+
my $i = $msges{$msg};
11+
unless (defined $i) {
12+
$i = [$msg, ''];
13+
push @list, $i;
14+
$msges{$msg} = $i;
15+
}
16+
$i->[1] .= "#: $filename:$line\n";
1017
}
1118

1219
while ( <@ARGV> ) {
@@ -44,6 +51,7 @@ ($$$)
4451
close IN;
4552
}
4653

47-
while (my ($k, $v) = each %msges) {
54+
foreach my $i (@list) {
55+
my ($k, $v) = @$i;
4856
print $v . "msgid \"$k\"\nmsgstr \"\"\n\n";
4957
}

0 commit comments

Comments
 (0)