updatelang: Add the ability to sort output file in the English file's order

Change-Id: Ia115549b96365cbee6f1f96c5b0351dcec538955
This commit is contained in:
Solomon Peachy 2024-07-28 20:42:17 -04:00
parent d5a4230901
commit 3c2a110728

View file

@ -158,7 +158,7 @@ sub reduceformat($) {
##################
if($#ARGV != 2) {
print "Usage: updatelang <english.lang> <otherlang> <outfile|->\n";
print "Usage: [ENGLISHORDER=1] updatelang <english.lang> <otherlang> <outfile|->\n";
exit;
}
@ -502,7 +502,14 @@ foreach (@langheader) {
print $fh $_;
}
my @finalorder = @langorder; # TODO make configurable vs @englishorder
my @finalorder;
if ($ENV{'ENGLISHORDER'}) {
@finalorder = @englishorder;
} else {
@finalorder = @langorder;
}
foreach my $id (@finalorder) {
if (!defined($english{$id})) {
next;