5 Usage: lang.pl <english file> <translated file>
12 open(ENG
, "<$ARGV[0]");
19 if($_ =~ /^ *([a-z]+): *(.*)/) {
20 ($var, $value) = ($1, $2);
21 # print "$var => $value\n";
26 # the last one for a single phrase
27 $all{$set{'id'}, 'desc'}=$set{'desc'};
28 $all{$set{'id'}, 'eng'}=$set{'eng'};
29 $all{$set{'id'}, 'voice'}=$set{'voice'};
39 open(NEW
, "<$ARGV[1]");
47 if($_ =~ /^ *([a-z]+): *(.*)/) {
48 ($var, $value) = ($1, $2);
53 # the last one for a single phrase
55 if(!$ids{$set{'id'}}) {
56 print "### ".$set{'id'}." was not found in the english file!\n";
60 print "\nid: ".$set{'id'}."\n";
62 if($set{'desc'} ne $all{$set{'id'}, 'desc'}) {
63 print "### Description changed! Previous description was:\n",
64 "### \"".$set{'desc'}."\"\n";
65 $set{'desc'} = $all{$set{'id'}, 'desc'};
67 print "desc: ".$set{'desc'}."\n";
69 if($set{'eng'} ne $all{$set{'id'}, 'eng'}) {
70 print "### English phrase was changed! Previous translation was made on:\n",
71 "### ".$set{'eng'}."\n";
72 $set{'eng'} = $all{$set{'id'}, 'eng'};
74 print "eng: ".$set{'eng'}."\n";
76 if($set{'voice'} ne $all{$set{'id'}, 'voice'}) {
77 print "### Voice string was changed! Previous version was:\n",
78 "### ".$set{'voice'}."\n";
79 $set{'voice'} = $all{$set{'id'}, 'voice'};
81 print "voice: ".$set{'voice'}."\n";
83 print "new: ".$set{'new'}."\n";
91 # output new phrases not already translated
96 print "desc: ".$all{$id, 'desc'}."\n";
97 print "eng: ".$all{$id, 'eng'}."\n";
98 print "### Not previously translated\n";