summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-10-11 22:01:24 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-10-11 22:01:24 +0000
commit1017e25438b3ca129dbe81e3d78f8f665fa39b27 (patch)
treed321aad0abaa8a67a30558af23d2ab9e85fadf78 /tools
parent567d84aa21dad01fe090fac9e1e63e3717ea324a (diff)
downloadrockbox-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
Diffstat (limited to 'tools')
-rwxr-xr-xtools/binlang16
-rwxr-xr-xtools/genlang9
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>) {
$value = $set{'eng'};
}
- $value =~ s/^\"(.*)\"/$1/g;
+ if($value =~ s/^\"(.*)\"/$1/g) {
- $idnum = $idnum{$set{'id'}};
- $idnum{$set{'id'}} = '_done_';
+ $idnum = $idnum{$set{'id'}};
+ $idnum{$set{'id'}} = '_done_';
- printf OFILE ("%c%c%s\x00",
- ($idnum>>8), ($idnum&0xff),
- $value);
+ printf OFILE ("%c%c%s\x00",
+ ($idnum>>8), ($idnum&0xff),
+ $value);
+ }
+ else {
+ warn "String for ".$set{'id'}." misses quotes\n";
+ }
undef %set;
}
diff --git a/tools/genlang b/tools/genlang
index 3d77540707..448784e49e 100755
--- a/tools/genlang
+++ b/tools/genlang
@@ -48,6 +48,7 @@ MOO
open(LANG, "<$input");
while(<LANG>) {
+ $line++;
if($_ =~ / *\#/) {
# comment
next;
@@ -56,10 +57,16 @@ while(<LANG>) {
$_ =~ s/\r//g;
if($_ =~ / *([a-z]+): *(.*)/) {
($var, $value) = ($1, $2);
- # print "$var => $value\n";
+ # print "$var => $value\n";
$set{$var} = $value;
+ if( (($var eq "new") && $value && ($value !~ /^\"(.*)\"$/)) ||
+ (($var eq "eng") && ($value !~ /^\"(.*)\"$/)) ) {
+ print "missing quotes on line $line for ".$set{'id'}."\n";
+ next;
+ }
+
if($var eq "new") {
# the last one for a single phrase