summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
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>) {
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
49open(LANG, "<$input"); 49open(LANG, "<$input");
50while(<LANG>) { 50while(<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