From 98a182a19fcec2a998fe98d9dc9d330c7e1b16b2 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Thu, 8 Jan 2026 08:17:20 -0500 Subject: [PATCH] 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 --- tools/genlang | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/genlang b/tools/genlang index 378ed7c154..95dfaddfbc 100755 --- a/tools/genlang +++ b/tools/genlang @@ -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; }