summaryrefslogtreecommitdiff
path: root/tools/genlang
diff options
context:
space:
mode:
Diffstat (limited to 'tools/genlang')
-rwxr-xr-xtools/genlang23
1 files changed, 20 insertions, 3 deletions
diff --git a/tools/genlang b/tools/genlang
index de9dd43920..fd0b498813 100755
--- a/tools/genlang
+++ b/tools/genlang
@@ -62,6 +62,7 @@ while(<LANG>) {
62 $set{$var} = $value; 62 $set{$var} = $value;
63 63
64 if( (($var eq "new") && $value && ($value !~ /^\"(.*)\"\W*$/)) || 64 if( (($var eq "new") && $value && ($value !~ /^\"(.*)\"\W*$/)) ||
65 (($var eq "voice") && $value && ($value !~ /^\"(.*)\"\W*$/)) ||
65 (($var eq "eng") && ($value !~ /^\"(.*)\"\W*$/)) ) { 66 (($var eq "eng") && ($value !~ /^\"(.*)\"\W*$/)) ) {
66 print "$input:$line:missing quotes for ".$set{'id'}."\n"; 67 print "$input:$line:missing quotes for ".$set{'id'}."\n";
67 $errors++; 68 $errors++;
@@ -75,9 +76,15 @@ while(<LANG>) {
75 # if not set, get the english version 76 # if not set, get the english version
76 $value = $set{'eng'}; 77 $value = $set{'eng'};
77 } 78 }
78 79# print "VOICE: ".$set{'voice'}." VALUE: $value\n";
79 print HFILE " ".$set{'id'}.",\n"; 80 if(($value eq "\"\"") && $set{'voice'}) {
80 print CFILE " $value,\n"; 81 # voice-only
82 push @vfile, $set{'id'};
83 }
84 else {
85 push @hfile, $set{'id'};
86 print CFILE " $value,\n";
87 }
81 88
82 undef %set; 89 undef %set;
83 } 90 }
@@ -87,6 +94,16 @@ while(<LANG>) {
87} 94}
88close(LANG); 95close(LANG);
89 96
97for(@hfile) {
98 print HFILE " $_,\n";
99}
100
101print HFILE " /* --- below this follows voice-only strings --- */\n",
102 " VOICEONLY_DELIMITER = 0x8000,\n";
103
104for(@vfile) {
105 print HFILE " $_,\n";
106}
90 107
91print HFILE <<MOO 108print HFILE <<MOO
92 LANG_LAST_INDEX_IN_ARRAY /* this is not a string, this is a marker */ 109 LANG_LAST_INDEX_IN_ARRAY /* this is not a string, this is a marker */