summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/genlang28
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/genlang b/tools/genlang
index 24b29b7d9a..45f7bc82d9 100755
--- a/tools/genlang
+++ b/tools/genlang
@@ -27,7 +27,7 @@ my $SUBHEADER_SIZE = 6;
27# the ability. But, starting now, this ability is no longer provided since I 27# the ability. But, starting now, this ability is no longer provided since I
28# figured it was boring and unnecessary to write support for now since we 28# figured it was boring and unnecessary to write support for now since we
29# don't use it anymore. 29# don't use it anymore.
30 30
31 31
32if(!$ARGV[0]) { 32if(!$ARGV[0]) {
33 print <<MOO 33 print <<MOO
@@ -263,7 +263,7 @@ sub readenglish {
263 my $withindest; 263 my $withindest;
264 my $numphrases = 0; 264 my $numphrases = 0;
265 my $numusers = 1; # core is already in the users map 265 my $numusers = 1; # core is already in the users map
266 266
267 while(<ENG>) { 267 while(<ENG>) {
268 268
269 # get rid of DOS newlines 269 # get rid of DOS newlines
@@ -440,7 +440,7 @@ while(<LANG>) {
440 if($dest eq '""' && $phrase{'desc'} !~ /deprecated/i && $idstr !~ /^VOICE/) { 440 if($dest eq '""' && $phrase{'desc'} !~ /deprecated/i && $idstr !~ /^VOICE/) {
441 print STDERR "$input:$line:1: warning: empty dest before line in non-deprecated phrase!\n"; 441 print STDERR "$input:$line:1: warning: empty dest before line in non-deprecated phrase!\n";
442 } 442 }
443 443
444 my $userstr = trim($phrase{'user'}); 444 my $userstr = trim($phrase{'user'});
445 my $user = $users{$userstr}; 445 my $user = $users{$userstr};
446 if ($userstr eq "") { 446 if ($userstr eq "") {
@@ -471,12 +471,12 @@ while(<LANG>) {
471 } 471 }
472 472
473 # Strip out the magic "Same as english" flag 473 # Strip out the magic "Same as english" flag
474 $dest =~ s/^("?)~/$1/; 474 $dest =~ s/^("?)~+/$1/;
475 $voice =~ s/^("?)~/$1/; 475 $voice =~ s/^("?)~+/$1/;
476 476
477 $id{$idstr} = $idnum; 477 $id{$idstr} = $idnum;
478 $idnum[$user][$idnum]=$idstr; 478 $idnum[$user][$idnum]=$idstr;
479 479
480 $source{$idstr}=$src; 480 $source{$idstr}=$src;
481 $dest{$idstr}=$dest; 481 $dest{$idstr}=$dest;
482 $voice{$idstr}=$voice; 482 $voice{$idstr}=$voice;
@@ -529,7 +529,7 @@ if($prefix) {
529 open(HFILE_CORE, ">$prefix/lang.h") || 529 open(HFILE_CORE, ">$prefix/lang.h") ||
530 die "Error: couldn't create file $prefix/lang.h\n"; 530 die "Error: couldn't create file $prefix/lang.h\n";
531 open(CFILE_CORE, ">$prefix/lang_core.c") || 531 open(CFILE_CORE, ">$prefix/lang_core.c") ||
532 die "Error: couldn't create file $prefix/lang_core.c\n"; 532 die "Error: couldn't create file $prefix/lang_core.c\n";
533 533
534 # get header file name 534 # get header file name
535 $headername = "$prefix/lang.h"; 535 $headername = "$prefix/lang.h";
@@ -572,7 +572,7 @@ MOO
572 print CFILE_CORE <<MOO 572 print CFILE_CORE <<MOO
573/* This file was automatically generated using genlang, the strings come 573/* This file was automatically generated using genlang, the strings come
574 from "$input" */ 574 from "$input" */
575 575
576#include "$headername" 576#include "$headername"
577 577
578unsigned char *language_strings[LANG_LAST_INDEX_IN_ARRAY]; 578unsigned char *language_strings[LANG_LAST_INDEX_IN_ARRAY];
@@ -584,9 +584,9 @@ MOO
584 my $i; 584 my $i;
585 for $i (0 .. $idcount[$users{"core"}]-1) { 585 for $i (0 .. $idcount[$users{"core"}]-1) {
586 my $name=$idnum[$users{"core"}][$i]; # get the ID name 586 my $name=$idnum[$users{"core"}][$i]; # get the ID name
587 587
588 $name =~ tr/\"//d; # cut off the quotes 588 $name =~ tr/\"//d; # cut off the quotes
589 589
590 printf HFILE_CORE (" %s, /* %d */\n", $name, $i); 590 printf HFILE_CORE (" %s, /* %d */\n", $name, $i);
591 } 591 }
592 592
@@ -602,9 +602,9 @@ MOO
602# Output the ID names for the enum in the header file 602# Output the ID names for the enum in the header file
603 for $i (0x8001 .. ($voiceid[$users{"core"}]-1)) { 603 for $i (0x8001 .. ($voiceid[$users{"core"}]-1)) {
604 my $name=$idnum[$users{"core"}][$i]; # get the ID name 604 my $name=$idnum[$users{"core"}][$i]; # get the ID name
605 605
606 $name =~ tr/\"//d; # cut off the quotes 606 $name =~ tr/\"//d; # cut off the quotes
607 607
608 printf HFILE_CORE (" %s, /* 0x%x */\n", $name, $i); 608 printf HFILE_CORE (" %s, /* 0x%x */\n", $name, $i);
609 } 609 }
610 610
@@ -621,7 +621,7 @@ MOO
621 for $i (0 .. $idcount[$users{"core"}]-1) { 621 for $i (0 .. $idcount[$users{"core"}]-1) {
622 my $name=$idnum[$users{"core"}][$i]; # get the ID 622 my $name=$idnum[$users{"core"}][$i]; # get the ID
623 my $dest = $dest{$name}; # get the destination phrase 623 my $dest = $dest{$name}; # get the destination phrase
624 624
625 $dest =~ s:\"$:\\0\":; # insert a \0 before the second quote 625 $dest =~ s:\"$:\\0\":; # insert a \0 before the second quote
626 626
627 if(!$dest) { 627 if(!$dest) {