summaryrefslogtreecommitdiffstats
path: root/tools/genlang
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 /tools/genlang
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
Diffstat (limited to 'tools/genlang')
-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 {
return $string;
}
+sub match {
+ my ($string, $pattern)=@_;
+
+ return ($string =~ /^$pattern\z/);
+}
+
+sub blank {
+ # nothing to do
+}
+
my %head;
sub header {
my ($full, $n, $v)=@_;
@@ -171,14 +181,13 @@ sub parsetarget {
my $string;
my @all= split(" *, *", $n);
my $test;
- my $regexp;
for $test (@all) {
$test =~ s/\*/.*/g;
$test =~ s/\?/./g;
- $regexp = qr/^$test\z/;
+
# print "TEST ($debug) $target for $test\n";
for my $part (@target_parts) {
- if($part =~ $regexp) {
+ if($part =~ /^$test\z/) {
$string = $v;
# print "MATCH: $test => $v\n";
$$strref = $string;
@@ -224,7 +233,7 @@ if($english) {
while(<ENG>) {
# get rid of DOS newlines
- $_ =~ tr/\r//d;
+ $_ =~ s/\r//g;
if($_ =~ /^ *\<phrase\>/) {
# this is the start of a phrase
@@ -341,7 +350,7 @@ sub compare {
$l = "### The 'desc' field differs from the english!\n### the previously used desc is commented below:\n### desc: $ldesc\n desc: $edesc\n";
}
push @show, $l;
- }
+ }
elsif($l =~ / *\<source\>/i) {
$mode=1;
push @show, $l;
@@ -400,7 +409,7 @@ while(<LANG>) {
$line++;
# get rid of DOS newlines
- $_ =~ tr/\r//d;
+ $_ =~ s/\r//g;
if($_ =~ /^( *\#|[ \t\n\r]*\z)/) {
# comment or empty line - output it if it's part of the header