From d71339bf4425b9688aad5ddc150f4daa18783397 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 10 Aug 2007 22:08:44 +0000 Subject: Fix for FS#7574. It previously failed to properly deal with multiple dest strings. I also added the numerical id number for strings in the generated header file, which is useful when the new lngdump tool is used and you want to compare the ids for the built-in strings to the ones in the generated binary files. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14274 a1c6a512-1295-4272-9138-f99709370657 --- tools/genlang | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'tools/genlang') diff --git a/tools/genlang b/tools/genlang index aa7e090c35..010a2b1303 100755 --- a/tools/genlang +++ b/tools/genlang @@ -230,9 +230,20 @@ if($english) { push @phrase, $_; if($_ =~ /^ *\/i) { $withindest=1; + $deststr=""; } elsif($withindest && ($_ =~ /^ *\<\/dest\>/i)) { $withindest=0; + + if($update || ($deststr && ($deststr !~ /^none\z/i))) { + # we unconditionally always use all IDs when the "update" + # feature is used + $id = $maybeid; + # print STDERR "DEST: use this id $id\n"; + } + else { + # print "skip $maybeid for $name\n"; + } } elsif($withindest && ($_ =~ / *([^:]+): *(.*)/)) { my ($name, $val)=($1, $2); @@ -240,13 +251,10 @@ if($english) { # model name isn't "our" dest($_, $name, $val); - # print STDERR "DEST: \"$dest\" for $name / $id\n"; - - if($update || ($dest && ($dest !~ /^none\z/i))) { - # we unconditionally always use all IDs when the "update" - # feature is used - $id = $maybeid; - # print STDERR "DEST: use this id $id\n"; + if($dest) { + # Store the current dest string. If this target matches + # multiple strings, it will get updated several times. + $deststr = $dest; } } } @@ -537,7 +545,7 @@ MOO $name =~ s/\"//g; # cut off the quotes - printf HFILE (" %s,\n", $name); + printf HFILE (" %s, /* %d */\n", $name, $i-1); } # Output separation marker for last string ID and the upcoming voice IDs -- cgit v1.2.3