diff options
author | Daniel Stenberg <daniel@haxx.se> | 2007-08-10 23:08:29 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2007-08-10 23:08:29 +0000 |
commit | 59975ccf3cf2daa85f4fcb4e8755199a3e5c7664 (patch) | |
tree | 7523798aac96ba295e344541bff0586fc51f726f /tools | |
parent | 2c4cae1bf3d91b753f246e6fc89d6ff7e4c0241b (diff) | |
download | rockbox-59975ccf3cf2daa85f4fcb4e8755199a3e5c7664.tar.gz rockbox-59975ccf3cf2daa85f4fcb4e8755199a3e5c7664.zip |
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
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/genlang | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/tools/genlang b/tools/genlang index 010a2b1303..4c0a9d6564 100755 --- a/tools/genlang +++ b/tools/genlang | |||
@@ -239,10 +239,10 @@ if($english) { | |||
239 | # we unconditionally always use all IDs when the "update" | 239 | # we unconditionally always use all IDs when the "update" |
240 | # feature is used | 240 | # feature is used |
241 | $id = $maybeid; | 241 | $id = $maybeid; |
242 | # print STDERR "DEST: use this id $id\n"; | 242 | # print "DEST: use this id $id\n"; |
243 | } | 243 | } |
244 | else { | 244 | else { |
245 | # print "skip $maybeid for $name\n"; | 245 | # print "skip $maybeid for $name\n"; |
246 | } | 246 | } |
247 | } | 247 | } |
248 | elsif($withindest && ($_ =~ / *([^:]+): *(.*)/)) { | 248 | elsif($withindest && ($_ =~ / *([^:]+): *(.*)/)) { |
@@ -434,7 +434,7 @@ while(<LANG>) { | |||
434 | $source{$idstr}=$src; | 434 | $source{$idstr}=$src; |
435 | $dest{$idstr}=$dest; | 435 | $dest{$idstr}=$dest; |
436 | $voice{$idstr}=$voice; | 436 | $voice{$idstr}=$voice; |
437 | 437 | ||
438 | if($verbose) { | 438 | if($verbose) { |
439 | print "id: $phrase{id} ($idnum)\n"; | 439 | print "id: $phrase{id} ($idnum)\n"; |
440 | print "source: $src\n"; | 440 | print "source: $src\n"; |
@@ -645,9 +645,15 @@ elsif($voiceout) { | |||
645 | # Now, make sure we get the number from the english sort order: | 645 | # Now, make sure we get the number from the english sort order: |
646 | $idnum = $idmap{$name}; | 646 | $idnum = $idmap{$name}; |
647 | 647 | ||
648 | $engl[$idnum] = $i; | 648 | if(length($idnum)) { |
649 | $engl[$idnum] = $i; | ||
649 | 650 | ||
650 | # print "Input index $i output index $idnum\n"; | 651 | #print "Input index $i output index $idnum\n"; |
652 | } | ||
653 | else { | ||
654 | # not used, mark it so | ||
655 | $engl[$i] = -1 | ||
656 | } | ||
651 | 657 | ||
652 | } | 658 | } |
653 | } | 659 | } |
@@ -655,10 +661,15 @@ elsif($voiceout) { | |||
655 | 661 | ||
656 | my $o = $engl[$i]; | 662 | my $o = $engl[$i]; |
657 | 663 | ||
664 | if(($o < 0) || !length($o)) { | ||
665 | print "#$i\nid: NOT_USED_$i\nvoice: \"\"\n"; | ||
666 | next; | ||
667 | } | ||
668 | |||
658 | my $name=$idnum[$o]; # get the ID | 669 | my $name=$idnum[$o]; # get the ID |
659 | my $dest = $voice{$name}; # get the destination voice string | 670 | my $dest = $voice{$name}; # get the destination voice string |
660 | 671 | ||
661 | print "#$i\nid: $name\nvoice: $dest\n"; | 672 | print "#$i ($o)\nid: $name\nvoice: $dest\n"; |
662 | } | 673 | } |
663 | 674 | ||
664 | } | 675 | } |