Ignore:
Timestamp:
2010-01-13T19:40:10+01:00 (17 years ago)
Author:
stoecker
Message:

i18n update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/i18n/i18n.pl

    r19356 r19496  
    77
    88my $waswarn = 0;
     9my $maxcount = 0;
    910
    1011main();
    … …  
    2728    my $linenum = 0;
    2829
     30    my $cnt = -1; # don't count translators info
    2931    if($file =~ /\/(.._..)\.po$/ || $file =~ /\/(..)\.po$/)
    3032    {
    … …  
    4850        {
    4951          my ($n, $d) = ($1, $2);
     52          ++$cnt if $n eq "msgid";
    5053          my $new = !${postate}{fuzzy} && (($n eq "msgid" && $postate{type} ne "msgctxt") || ($n eq "msgctxt"));
    5154          checkpo(\%postate, \%all, $l, "line $linenum in $file", $keys, $new);
    … …  
    6568      die "File format not supported for file $file.";
    6669    }
     70    $maxcount = $cnt if $cnt > $maxcount;
    6771    close(FILE);
    6872  }
    … …  
    202206  {
    203207    my $la;
     208    my $cnt = 0;
    204209    if($file =~ /[-_](.._..)\.lang$/ || $file =~ /^(?:.*\/)?(.._..)\.lang$/ ||
    205210    $file =~ /[-_](...?)\.lang$/ || $file =~ /^(?:.*\/)?(..)\.lang$/)
    206211    {
    207       print "Creating file $file\n";
    208212      $la = $1;
    209213    }
    … …  
    220224      if($la eq "en")
    221225      {
     226        ++$cnt;
    222227        $val = $en;
    223228        $val =~ s/^___(.*)___/_:$1\n/;
    … …  
    228233        $ennoctx =~ s/^___(.*)___//;
    229234        $val = (exists($data->{$en}{$la})) ? $data->{$en}{$la} : "";
     235        ++$cnt if $val;
    230236        $val = "" if($ennoctx eq $val);
    231237      }
    … …  
    242248      if($la eq "en")
    243249      {
     250        ++$cnt;
    244251        $val = $en;
    245252        $val =~ s/^___(.*)___/_:$1\n/;
    … …  
    249256        $val = (exists($data->{$en}{$la})) ? $data->{$en}{$la} : "";
    250257        --$num if(!$val);
     258        ++$cnt if $val;
    251259        if($num == 2)
    252260        {
    … …  
    268276    }
    269277    close FILE;
     278    print "Created file $file: Added $cnt strings out of $maxcount.\n";
    270279  }
    271280}
Note: See TracChangeset for help on using the changeset viewer.