genlang: More fixes

* "english.list" started the VOICE_* enumeration at the wrong number
 * vstrings file had the wrong string count

There is still one remaining issue; Currently the vstrings header is
generated with a section size that is consistently 6 bytes shorter than
the actual data. However, the non-voice .lng file has correct size.

Change-Id: I01f9622399cf3f3ac4c62ddea1deeb19a7b028ba
This commit is contained in:
Solomon Peachy 2026-01-08 08:17:20 -05:00
parent 24220d13e5
commit 98a182a19f

View file

@ -214,7 +214,7 @@ sub readenglish {
# do it before we read the translated file.
my @idnum = ((0)); # start with a true number
my @vidnum = ((0x8000)); # first voice id
my @vidnum = ((0x8001)); # first voice id
if ($binary and file_is_newer("$binpath/english.list", $english)) {
open(ENG, "<$binpath/english.list") ||
@ -256,7 +256,6 @@ sub readenglish {
# Assign an ID number to this entry
$idmap[$user]{$id}=$idnum[$user];
$idnum[$user]++;
# print STDERR "DEST: bumped idnum to $idnum[$user]\n";
}
# this is the end of a phrase, add it to the english hash
@ -624,21 +623,25 @@ elsif($binary || $binvoice) {
my $sizeb = 0;
for $n (0 .. $idcount[$_]-1) {
$sizeb += length(trim($dest{$idnum[$_][$n]})) + 1;
}
}
printf OUTF ("%c%c%c%c%c%c", ($idcount[$_] >> 8), ($idcount[$_] & 0xff),
($sizeb >> 8), ($sizeb & 0xff), ($foffsetb >> 8), ($foffsetb & 0xff));
$foffsetb += $sizeb;
}
if($binvoice) {
my $sizev = 0;
my $count = 0;
# All LANG_* and all VOICE_*
for $n (0 .. $idcount[$_]-1) {
$sizev += length(trim($voice{$idnum[$_][$n]})) + 1;
$count++;
}
for $n (0x8001 .. $voiceid[$_]-1) {
$sizev += length(trim($voice{$idnum[$_][$n]})) + 1;
$count++;
}
printf OUTV ("%c%c%c%c%c%c", ($idcount[$_] >> 8), ($idcount[$_] & 0xff),
printf OUTV ("%c%c%c%c%c%c", ($count >> 8), ($count & 0xff),
($sizev >> 8), ($sizev & 0xff), ($foffsetv >> 8), ($foffsetv & 0xff));
$foffsetv += $sizev;
}