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

Last change on this file since 13295 was 13295, checked in by stoecker, 15 years ago

updated

  • Property svn:executable set to *
File size: 1.5 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/(Orthogonali|synchroni|Initiali|customi)z/$1s/ig;
44 $msgid =~ s/(licen)s/$1c/ig;
45 $msgid =~ s/(spel)led/$1t/ig;
46 return $msgid;
47}
48
49sub check
50{
51 if($type eq "msgid") {$msgid = $last;$msgid_pl="";}
52 elsif($type eq "msgid_plural") {$msgid_pl = $last;}
53 elsif($type eq "msgstr[0]") {$msgstr = $last;}
54 else
55 {
56 if($type eq "msgstr") {$msgstr = $last;}
57 elsif($type eq "msgstr[1]") {$msgstr_pl = $last;}
58 if((!$fuzzy) && $msgstr && $msgid)
59 {
60 $msgid = fixstr($msgid) if($msgstr ne $msgid);
61 if($msgstr ne $msgid) { print " $msgid\n=>$msgstr\n"; }
62 if($msgid_pl && $msgstr_pl ne $msgid_pl) { print " $msgid_pl\np>$msgstr_pl\n"; }
63 }
64 $msgid = "";
65 $msgstr = "";
66 $msgid_pl = "";
67 $msgstr_pl = "";
68 $type = "";
69 }
70}
Note: See TracBrowser for help on using the repository browser.