source: osm/applications/editors/josm/i18n/checkenglish.pl@ 24523

Last change on this file since 24523 was 15960, checked in by stoecker, 16 years ago

fixed typos

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#! /usr/bin/perl -w
2
3# Show diffs in en_GB.
4# Find errors in original texts which have silently been fixed by native
5# english speakers instead of informing the authors.
6
7open FILE,"<","po/en_GB.po" or die;
8my $last = "";
9my $type = "";
10my $msgid;
11my $msgid_pl;
12my $msgstr;
13my $msgstr_pl;
14my $fuzzy;
15while(<FILE>)
16{
17 chomp;
18 if($_ =~ /^#/ || !$_)
19 {
20 check();
21 $fuzzy = ($_ =~ /fuzzy/);
22 next;
23 }
24 if($_ =~ /^"(.*)"$/) {$last .= $1;}
25 elsif($_ =~ /^(msg.+) "(.*)"$/)
26 {
27 check();
28 $last=$2;$type =$1;
29 }
30 else
31 {
32 die "Strange line";
33 }
34}
35
36sub fixstr($)
37{
38 my $msgid = shift;
39 $msgid =~ s/(colo)(r)/$1u$2/ig;
40 $msgid =~ s/(gr)a(y)/$1e$2/ig;
41 $msgid =~ s/([^\w]+cent|met)(e)(r)/$1$3$2/ig;
42 $msgid =~ s/^(cent|met)(e)(r)/$1$3$2/ig;
43 $msgid =~ s/(minimi|maximi|vectori|anonymi|Orthogonali|synchroni|Initiali|customi)z/$1s/ig;
44 $msgid =~ s/(licen)s/$1c/ig;
45 $msgid =~ s/dialog/dialogue/ig;
46 $msgid =~ s/(spel)led/$1t/ig;
47 $msgid =~ s/_/ /ig;
48 return $msgid;
49}
50
51sub check
52{
53 if($type eq "msgid") {$msgid = $last;$msgid_pl="";}
54 elsif($type eq "msgid_plural") {$msgid_pl = $last;}
55 elsif($type eq "msgstr[0]") {$msgstr = $last;}
56 else
57 {
58 if($type eq "msgstr") {$msgstr = $last;}
59 elsif($type eq "msgstr[1]") {$msgstr_pl = $last;}
60 if((!$fuzzy) && $msgstr && $msgid)
61 {
62 $msgid = fixstr($msgid) if($msgstr ne $msgid);
63 if($msgstr ne $msgid) { print " $msgid\n=>$msgstr\n"; }
64 if($msgid_pl && $msgstr_pl ne $msgid_pl) { print " $msgid_pl\np>$msgstr_pl\n"; }
65 }
66 $msgid = "";
67 $msgstr = "";
68 $msgid_pl = "";
69 $msgstr_pl = "";
70 $type = "";
71 }
72}
Note: See TracBrowser for help on using the repository browser.