summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-08-10 22:08:44 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-08-10 22:08:44 +0000
commitd71339bf4425b9688aad5ddc150f4daa18783397 (patch)
treea67e1effaa5d6b631196c779c0db999892ba6b4a
parent39dfd68e2f6f68ae0cff11323f6a33784540d26e (diff)
downloadrockbox-d71339bf4425b9688aad5ddc150f4daa18783397.tar.gz
rockbox-d71339bf4425b9688aad5ddc150f4daa18783397.zip
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
-rwxr-xr-xtools/genlang24
1 files changed, 16 insertions, 8 deletions
diff --git a/tools/genlang b/tools/genlang
index aa7e090c35..010a2b1303 100755
--- a/tools/genlang
+++ b/tools/genlang
@@ -230,9 +230,20 @@ if($english) {
230 push @phrase, $_; 230 push @phrase, $_;
231 if($_ =~ /^ *\<dest\>/i) { 231 if($_ =~ /^ *\<dest\>/i) {
232 $withindest=1; 232 $withindest=1;
233 $deststr="";
233 } 234 }
234 elsif($withindest && ($_ =~ /^ *\<\/dest\>/i)) { 235 elsif($withindest && ($_ =~ /^ *\<\/dest\>/i)) {
235 $withindest=0; 236 $withindest=0;
237
238 if($update || ($deststr && ($deststr !~ /^none\z/i))) {
239 # we unconditionally always use all IDs when the "update"
240 # feature is used
241 $id = $maybeid;
242 # print STDERR "DEST: use this id $id\n";
243 }
244 else {
245 # print "skip $maybeid for $name\n";
246 }
236 } 247 }
237 elsif($withindest && ($_ =~ / *([^:]+): *(.*)/)) { 248 elsif($withindest && ($_ =~ / *([^:]+): *(.*)/)) {
238 my ($name, $val)=($1, $2); 249 my ($name, $val)=($1, $2);
@@ -240,13 +251,10 @@ if($english) {
240 # model name isn't "our" 251 # model name isn't "our"
241 dest($_, $name, $val); 252 dest($_, $name, $val);
242 253
243 # print STDERR "DEST: \"$dest\" for $name / $id\n"; 254 if($dest) {
244 255 # Store the current dest string. If this target matches
245 if($update || ($dest && ($dest !~ /^none\z/i))) { 256 # multiple strings, it will get updated several times.
246 # we unconditionally always use all IDs when the "update" 257 $deststr = $dest;
247 # feature is used
248 $id = $maybeid;
249 # print STDERR "DEST: use this id $id\n";
250 } 258 }
251 } 259 }
252 } 260 }
@@ -537,7 +545,7 @@ MOO
537 545
538 $name =~ s/\"//g; # cut off the quotes 546 $name =~ s/\"//g; # cut off the quotes
539 547
540 printf HFILE (" %s,\n", $name); 548 printf HFILE (" %s, /* %d */\n", $name, $i-1);
541 } 549 }
542 550
543# Output separation marker for last string ID and the upcoming voice IDs 551# Output separation marker for last string ID and the upcoming voice IDs