summaryrefslogtreecommitdiffstats
path: root/tools/genlang
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-08-10 23:08:29 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-08-10 23:08:29 +0000
commit59975ccf3cf2daa85f4fcb4e8755199a3e5c7664 (patch)
tree7523798aac96ba295e344541bff0586fc51f726f /tools/genlang
parent2c4cae1bf3d91b753f246e6fc89d6ff7e4c0241b (diff)
downloadrockbox-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/genlang')
-rwxr-xr-xtools/genlang23
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) {
# 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(<LANG>) {
$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";
}
}