From 59975ccf3cf2daa85f4fcb4e8755199a3e5c7664 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 10 Aug 2007 23:08:29 +0000 Subject: fix the -o output for indexes where there's no voice given, this is for FS#7576, and it typically caused a bazillion of LANG_SET_BOOL_YES to get output when -o was used with non-english git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14277 a1c6a512-1295-4272-9138-f99709370657 --- tools/genlang | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/genlang b/tools/genlang index 010a2b1303..4c0a9d6564 100755 --- a/tools/genlang +++ b/tools/genlang @@ -239,10 +239,10 @@ if($english) { # we unconditionally always use all IDs when the "update" # feature is used $id = $maybeid; - # print STDERR "DEST: use this id $id\n"; + # print "DEST: use this id $id\n"; } else { - # print "skip $maybeid for $name\n"; + # print "skip $maybeid for $name\n"; } } elsif($withindest && ($_ =~ / *([^:]+): *(.*)/)) { @@ -434,7 +434,7 @@ while() { $source{$idstr}=$src; $dest{$idstr}=$dest; $voice{$idstr}=$voice; - + if($verbose) { print "id: $phrase{id} ($idnum)\n"; print "source: $src\n"; @@ -645,9 +645,15 @@ elsif($voiceout) { # Now, make sure we get the number from the english sort order: $idnum = $idmap{$name}; - $engl[$idnum] = $i; + if(length($idnum)) { + $engl[$idnum] = $i; - # print "Input index $i output index $idnum\n"; + #print "Input index $i output index $idnum\n"; + } + else { + # not used, mark it so + $engl[$i] = -1 + } } } @@ -655,10 +661,15 @@ elsif($voiceout) { my $o = $engl[$i]; + if(($o < 0) || !length($o)) { + print "#$i\nid: NOT_USED_$i\nvoice: \"\"\n"; + next; + } + my $name=$idnum[$o]; # get the ID my $dest = $voice{$name}; # get the destination voice string - print "#$i\nid: $name\nvoice: $dest\n"; + print "#$i ($o)\nid: $name\nvoice: $dest\n"; } } -- cgit v1.2.3