diff options
author | Daniel Stenberg <daniel@haxx.se> | 2006-10-18 07:41:00 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2006-10-18 07:41:00 +0000 |
commit | 537c90b2867993d268e4fb19d55bf923a64de634 (patch) | |
tree | 9b42d393fccead68534c1fc501a742f55a969298 /tools/genlang | |
parent | 6fdd4b0837e03f7e10d4b573c4e05c3cb0079b1e (diff) | |
download | rockbox-537c90b2867993d268e4fb19d55bf923a64de634.tar.gz rockbox-537c90b2867993d268e4fb19d55bf923a64de634.zip |
Make -t support a range of "targets", which reallly should be one target
and a range of named features.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11254 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/genlang')
-rwxr-xr-x | tools/genlang | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/genlang b/tools/genlang index 363ef96cf9..86cb367dd2 100755 --- a/tools/genlang +++ b/tools/genlang @@ -22,7 +22,7 @@ my $langversion = 3; # 3 was the latest one used in the v1 format if(!$ARGV[0]) { print <<MOO -Usage: genlang2 [options] <langv2 file> +Usage: genlang [options] <langv2 file> -p=<prefix> Make the tool create a [prefix].c and [prefix].h file. @@ -44,6 +44,10 @@ Usage: genlang2 [options] <langv2 file> Specify which target you want the translations/phrases for. Required when -b or -p is used. + The target can in fact be specified as numerous different strings, + separated with colons. This will make genlang to use all the specified + strings when searching for a matching phrase. + -o Voice mode output. Outputs all id: and voice: lines for the given target! @@ -140,15 +144,15 @@ sub parsetarget { my $test; for $test (@all) { # print "TEST ($debug) $target for $test\n"; - if(match($target, $test)) { - $string = $v; -# print "MATCH: $test => $v\n"; + for my $part (split(":", $target)) { + if(match($part, $test)) { + $string = $v; +# print "MATCH: $test => $v\n"; + $$strref = $string; + return $string; + } } } - if($string) { - $$strref = $string; - } - return $string; } my $src; @@ -446,7 +450,7 @@ if($prefix) { die "couldn't create file $prefix.c\n"; print HFILE <<MOO -/* This file was automatically generated using genlang2 */ +/* This file was automatically generated using genlang */ /* * The str() macro/functions is how to access strings that might be * translated. Use it like str(MACRO) and expect a string to be @@ -466,7 +470,7 @@ MOO ; print CFILE <<MOO -/* This file was automaticly generated using genlang2, the strings come +/* This file was automaticly generated using genlang, the strings come from "$input" */ #include "$prefix.h" @@ -496,7 +500,6 @@ MOO ; # Output the ID names for the enum in the header file - my $i; for $i (0x8000 .. ($voiceid-1)) { my $name=$idnum[$i]; # get the ID name @@ -557,9 +560,6 @@ elsif($binary) { $idnum = $idmap{$name}; printf OUTF ("%c%c%s\x00", ($idnum>>8), ($idnum&0xff), $dest); - if($debug) { - printf("%02x => %s\n", $idnum, $value); - } } } } |