summaryrefslogtreecommitdiffstats
path: root/tools
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 /tools
parent39dfd68e2f6f68ae0cff11323f6a33784540d26e (diff)
downloadrockbox-d71339bf4425b9688aad5ddc150f4daa18783397.tar.gz
rockbox-d71339bf4425b9688aad5ddc150f4daa18783397.tar.bz2
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
Diffstat (limited to 'tools')
-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) {
push @phrase, $_;
if($_ =~ /^ *\<dest\>/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