Changeset 3422
- Timestamp:
- 2002-09-11T11:35:28+12:00 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/macros/Chktrans.pl
r1099 r3422 3 3 use strict; 4 4 5 my @languages = ("chinese", "french", "german", "maori" );5 my @languages = ("chinese", "french", "german", "maori", "spanish", "turkish"); 6 6 7 7 print " … … 29 29 my $count = 0; 30 30 my %macro; 31 31 my $package=""; 32 32 while (<E>) { 33 33 chomp; 34 34 $line = $_; 35 36 next unless ($line =~ /^_\w+_ +\{/); 37 38 $line =~ s/ +\{.*//; 39 $macro{$line} = 1; 35 if ($line =~ /^package\s+(\w+)/) { 36 $package="$1:"; 37 next; 38 } 39 next unless ($line =~ /^_\w+_ *\{/); 40 # don't necessarily have space between macro and { - eg _macro_{content} 41 $line =~ s/_\s*\{.*/_/; 42 $macro{"$package$line"} = 1; 40 43 $count++; 41 44 } … … 61 64 my (%lm, %lmnew, %lr, %lrnew); 62 65 my $lc = 0; 66 $package = ""; 63 67 while (<L>) { 64 68 chomp; 65 69 $line = $_; 66 70 71 if ($line =~ /^package\s+(\w+)/) { 72 $package="$1:"; 73 next; 74 } 67 75 next unless ($line =~ /^_\w+_/); 68 76 next unless ($line =~ /\{/); 69 77 70 $line =~ s/ +\{.*//;78 $line =~ s/_\s*\{.*/_/; 71 79 # There are four types of macro, the combos of: 72 80 # With or without macro country code 73 81 # Present or not present in %macro 74 82 if ($line =~ /\[/) { 75 $line =~ s/ .*//; 76 if (defined($macro{$line})) { 77 $lm{$line} = $line; 83 # don't need a space between macro and arg (_macro_[args]) 84 # $line =~ s/\s.*//; 85 $line =~ s/\s*\[.*//; 86 my $thismacro="$package$line"; 87 if (defined($macro{$thismacro})) { 88 $lm{$thismacro} = $thismacro; 78 89 } else { 79 $lmnew{$ line} = $line;90 $lmnew{$thismacro} = $thismacro; 80 91 } 81 92 } else { 82 if (defined($macro{$line})) { 83 $lr{$line} = $line; 93 my $thismacro="$package$line"; 94 if (defined($macro{$thismacro})) { 95 $lr{$thismacro} = $thismacro; 84 96 } else { 85 $lrnew{$ line} = $line;97 $lrnew{$thismacro} = $thismacro; 86 98 } 87 99 }
Note:
See TracChangeset
for help on using the changeset viewer.