Last change
on this file since 25485 was 15960, checked in by stoecker, 15 years ago |
fixed typos
|
-
Property svn:executable
set to
*
|
File size:
1.6 KB
|
Rev | Line | |
---|
[13295] | 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 |
|
---|
| 7 | open FILE,"<","po/en_GB.po" or die;
|
---|
| 8 | my $last = "";
|
---|
| 9 | my $type = "";
|
---|
| 10 | my $msgid;
|
---|
| 11 | my $msgid_pl;
|
---|
| 12 | my $msgstr;
|
---|
| 13 | my $msgstr_pl;
|
---|
| 14 | my $fuzzy;
|
---|
| 15 | while(<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 |
|
---|
| 36 | sub 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;
|
---|
[15960] | 43 | $msgid =~ s/(minimi|maximi|vectori|anonymi|Orthogonali|synchroni|Initiali|customi)z/$1s/ig;
|
---|
[13295] | 44 | $msgid =~ s/(licen)s/$1c/ig;
|
---|
[15960] | 45 | $msgid =~ s/dialog/dialogue/ig;
|
---|
[13295] | 46 | $msgid =~ s/(spel)led/$1t/ig;
|
---|
[15960] | 47 | $msgid =~ s/_/ /ig;
|
---|
[13295] | 48 | return $msgid;
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | sub 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.