From 537c90b2867993d268e4fb19d55bf923a64de634 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 18 Oct 2006 07:41:00 +0000 Subject: 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 --- tools/genlang | 28 ++++++++++++++-------------- 1 file 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 < +Usage: genlang [options] -p= Make the tool create a [prefix].c and [prefix].h file. @@ -44,6 +44,10 @@ Usage: genlang2 [options] 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 <>8), ($idnum&0xff), $dest); - if($debug) { - printf("%02x => %s\n", $idnum, $value); - } } } } -- cgit v1.2.3