diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-10-11 22:01:24 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-10-11 22:01:24 +0000 |
commit | 1017e25438b3ca129dbe81e3d78f8f665fa39b27 (patch) | |
tree | d321aad0abaa8a67a30558af23d2ab9e85fadf78 | |
parent | 567d84aa21dad01fe090fac9e1e63e3717ea324a (diff) | |
download | rockbox-1017e25438b3ca129dbe81e3d78f8f665fa39b27.tar.gz rockbox-1017e25438b3ca129dbe81e3d78f8f665fa39b27.zip |
check for quotes better and warn/skip bad ones
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2592 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-x | tools/binlang | 16 | ||||
-rwxr-xr-x | tools/genlang | 9 |
2 files changed, 18 insertions, 7 deletions
diff --git a/tools/binlang b/tools/binlang index ed158e7f2a..e77830fc6e 100755 --- a/tools/binlang +++ b/tools/binlang | |||
@@ -89,14 +89,18 @@ while(<LANG>) { | |||
89 | $value = $set{'eng'}; | 89 | $value = $set{'eng'}; |
90 | } | 90 | } |
91 | 91 | ||
92 | $value =~ s/^\"(.*)\"/$1/g; | 92 | if($value =~ s/^\"(.*)\"/$1/g) { |
93 | 93 | ||
94 | $idnum = $idnum{$set{'id'}}; | 94 | $idnum = $idnum{$set{'id'}}; |
95 | $idnum{$set{'id'}} = '_done_'; | 95 | $idnum{$set{'id'}} = '_done_'; |
96 | 96 | ||
97 | printf OFILE ("%c%c%s\x00", | 97 | printf OFILE ("%c%c%s\x00", |
98 | ($idnum>>8), ($idnum&0xff), | 98 | ($idnum>>8), ($idnum&0xff), |
99 | $value); | 99 | $value); |
100 | } | ||
101 | else { | ||
102 | warn "String for ".$set{'id'}." misses quotes\n"; | ||
103 | } | ||
100 | 104 | ||
101 | undef %set; | 105 | undef %set; |
102 | } | 106 | } |
diff --git a/tools/genlang b/tools/genlang index 3d77540707..448784e49e 100755 --- a/tools/genlang +++ b/tools/genlang | |||
@@ -48,6 +48,7 @@ MOO | |||
48 | 48 | ||
49 | open(LANG, "<$input"); | 49 | open(LANG, "<$input"); |
50 | while(<LANG>) { | 50 | while(<LANG>) { |
51 | $line++; | ||
51 | if($_ =~ / *\#/) { | 52 | if($_ =~ / *\#/) { |
52 | # comment | 53 | # comment |
53 | next; | 54 | next; |
@@ -56,10 +57,16 @@ while(<LANG>) { | |||
56 | $_ =~ s/\r//g; | 57 | $_ =~ s/\r//g; |
57 | if($_ =~ / *([a-z]+): *(.*)/) { | 58 | if($_ =~ / *([a-z]+): *(.*)/) { |
58 | ($var, $value) = ($1, $2); | 59 | ($var, $value) = ($1, $2); |
59 | # print "$var => $value\n"; | 60 | # print "$var => $value\n"; |
60 | 61 | ||
61 | $set{$var} = $value; | 62 | $set{$var} = $value; |
62 | 63 | ||
64 | if( (($var eq "new") && $value && ($value !~ /^\"(.*)\"$/)) || | ||
65 | (($var eq "eng") && ($value !~ /^\"(.*)\"$/)) ) { | ||
66 | print "missing quotes on line $line for ".$set{'id'}."\n"; | ||
67 | next; | ||
68 | } | ||
69 | |||
63 | if($var eq "new") { | 70 | if($var eq "new") { |
64 | # the last one for a single phrase | 71 | # the last one for a single phrase |
65 | 72 | ||