summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2011-03-02 09:42:51 +0000
committerMarcin Bukat <marcin.bukat@gmail.com>2011-03-02 09:42:51 +0000
commitd233066155ab1b6fff26f4b4c8faa9507f0eca84 (patch)
tree88efc07bb47c9a49204894811539b01aa7809417
parentc9b0044274bc3871311e84ced66f4aaec6b48355 (diff)
downloadrockbox-d233066155ab1b6fff26f4b4c8faa9507f0eca84.tar.gz
rockbox-d233066155ab1b6fff26f4b4c8faa9507f0eca84.zip
Revert r29494 as It is a) buggy b) doesn't seem to do any good in terms of speed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29495 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-xtools/genlang21
1 files changed, 15 insertions, 6 deletions
diff --git a/tools/genlang b/tools/genlang
index 6a63f8004e..81d5066453 100755
--- a/tools/genlang
+++ b/tools/genlang
@@ -148,6 +148,16 @@ sub trim {
148 return $string; 148 return $string;
149} 149}
150 150
151sub match {
152 my ($string, $pattern)=@_;
153
154 return ($string =~ /^$pattern\z/);
155}
156
157sub blank {
158 # nothing to do
159}
160
151my %head; 161my %head;
152sub header { 162sub header {
153 my ($full, $n, $v)=@_; 163 my ($full, $n, $v)=@_;
@@ -171,14 +181,13 @@ sub parsetarget {
171 my $string; 181 my $string;
172 my @all= split(" *, *", $n); 182 my @all= split(" *, *", $n);
173 my $test; 183 my $test;
174 my $regexp;
175 for $test (@all) { 184 for $test (@all) {
176 $test =~ s/\*/.*/g; 185 $test =~ s/\*/.*/g;
177 $test =~ s/\?/./g; 186 $test =~ s/\?/./g;
178 $regexp = qr/^$test\z/; 187
179# print "TEST ($debug) $target for $test\n"; 188# print "TEST ($debug) $target for $test\n";
180 for my $part (@target_parts) { 189 for my $part (@target_parts) {
181 if($part =~ $regexp) { 190 if($part =~ /^$test\z/) {
182 $string = $v; 191 $string = $v;
183# print "MATCH: $test => $v\n"; 192# print "MATCH: $test => $v\n";
184 $$strref = $string; 193 $$strref = $string;
@@ -224,7 +233,7 @@ if($english) {
224 while(<ENG>) { 233 while(<ENG>) {
225 234
226 # get rid of DOS newlines 235 # get rid of DOS newlines
227 $_ =~ tr/\r//d; 236 $_ =~ s/\r//g;
228 237
229 if($_ =~ /^ *\<phrase\>/) { 238 if($_ =~ /^ *\<phrase\>/) {
230 # this is the start of a phrase 239 # this is the start of a phrase
@@ -341,7 +350,7 @@ sub compare {
341 $l = "### The 'desc' field differs from the english!\n### the previously used desc is commented below:\n### desc: $ldesc\n desc: $edesc\n"; 350 $l = "### The 'desc' field differs from the english!\n### the previously used desc is commented below:\n### desc: $ldesc\n desc: $edesc\n";
342 } 351 }
343 push @show, $l; 352 push @show, $l;
344 } 353 }
345 elsif($l =~ / *\<source\>/i) { 354 elsif($l =~ / *\<source\>/i) {
346 $mode=1; 355 $mode=1;
347 push @show, $l; 356 push @show, $l;
@@ -400,7 +409,7 @@ while(<LANG>) {
400 $line++; 409 $line++;
401 410
402 # get rid of DOS newlines 411 # get rid of DOS newlines
403 $_ =~ tr/\r//d; 412 $_ =~ s/\r//g;
404 413
405 if($_ =~ /^( *\#|[ \t\n\r]*\z)/) { 414 if($_ =~ /^( *\#|[ \t\n\r]*\z)/) {
406 # comment or empty line - output it if it's part of the header 415 # comment or empty line - output it if it's part of the header