2 # umtrans.pl version 1.0 (April 8, 2001)
3 # Extracts translation strings from UseModWiki script.
4 # Run the script with one or two arguments, like:
5 # umtrans.pl wiki.pl > trans.pl
6 # ... creates a new/empty translation table from wiki.pl
7 # umtrans.pl wiki.pl trans.pl > newtrans.pl
8 # ... creates a new translation table using wiki.pl and an old table
10 if ((@ARGV < 1) || (@ARGV > 2)) {
12 die("Wrong number of arguments");
17 do (pop(@ARGV)); # Evaluate second argument and remove it
26 $result = $Translate{$string} if (defined($Translate{$string}));
27 return ' ' if ($seen{$string});
29 print $string . "\n" . $result . "\n";
33 print '%Translate = split(\'\n\',<<END_OF_TRANSLATION);' . "\n";
35 s/Ts?s?\(\'([^']+)/&trans($1)/ge;
36 s/Ts?s?\(\"([^"]+)/&trans($1)/ge;
39 print "END_OF_TRANSLATION\n";