/[webwml]/webwml/stattrans.pl
ViewVC logotype

Diff of /webwml/stattrans.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by kraai, Tue Sep 11 17:43:17 2001 UTC revision 1.27 by kraai, Tue Sep 11 17:56:22 2001 UTC
# Line 87  $date = strftime "%a %b %e %H:%M:%S %Y % Line 87  $date = strftime "%a %b %e %H:%M:%S %Y %
87  my %original;  my %original;
88  my %transversion;  my %transversion;
89  my %version;  my %version;
90    my %files;
91    
92  # Count wml files in given directory  # Count wml files in given directory
93  #  #
# Line 113  sub getwmlfiles Line 114  sub getwmlfiles
114          $file = substr ($f, $cutfrom);          $file = substr ($f, $cutfrom);
115          next if $transignore->is_global($file);          next if $transignore->is_global($file);
116          $file =~ s/\.wml$//;          $file =~ s/\.wml$//;
117            $files{$file} = 1;
118          $wmlfiles{$lang} .= " " . $file;          $wmlfiles{$lang} .= " " . $file;
119          my $transcheck = Webwml::TransCheck->new("$dir/$file.wml");          my $transcheck = Webwml::TransCheck->new("$dir/$file.wml");
120          if ($transcheck->revision()) {          if ($transcheck->revision()) {
# Line 199  print "\n" if ($config{'verbose'}); Line 201  print "\n" if ($config{'verbose'});
201  # =============== Create HTML files ===============  # =============== Create HTML files ===============
202  mkdir ($config{'htmldir'}, 02775) if (! -d $config{'htmldir'});  mkdir ($config{'htmldir'}, 02775) if (! -d $config{'htmldir'});
203    
204  @sorted_english = sort (split (/ /, $wmlfiles{'english'}));  my @filenames = sort keys %files;
205    my $nfiles = scalar @filenames;
206    
207  print "Creating files: " if ($config{'verbose'});  print "Creating files: " if ($config{'verbose'});
208  my @search_in;  my @search_in;
# Line 215  foreach $lang (@search_in) { Line 218  foreach $lang (@search_in) {
218    
219      $t_body = $u_body = $o_body = "";      $t_body = $u_body = $o_body = "";
220    
221      foreach $file (@sorted_english) {      foreach $file (@filenames) {
222          next if ($file eq "");          next if ($file eq "");
223          # Translated pages          # Translated pages
224          if (index ($wmlfiles{$lang}, " $file ") >= 0) {          if (index ($wmlfiles{$lang}, " $file ") >= 0) {
# Line 260  foreach $lang (@search_in) { Line 263  foreach $lang (@search_in) {
263      $wml{$lang} = $translated{$lang};      $wml{$lang} = $translated{$lang};
264      $translated{$lang} = $translated{$lang} - $outdated{$lang};      $translated{$lang} = $translated{$lang} - $outdated{$lang};
265    
266      $percent_a{$lang} = $wml{$lang}/$wml{english} * 100;      $percent_a{$lang} = $wml{$lang}/$nfiles * 100;
267      $percent_t{$lang} = $translated{$lang}/$wml{english} * 100;      $percent_t{$lang} = $translated{$lang}/$nfiles * 100;
268      $percent_o{$lang} = $outdated{$lang}/$wml{english} * 100;      $percent_o{$lang} = $outdated{$lang}/$nfiles * 100;
269      $percent_u{$lang} = $untranslated{$lang}/$wml{english} * 100;      $percent_u{$lang} = $untranslated{$lang}/$nfiles * 100;
270    
271      if (open (HTML, ">$config{'htmldir'}/$l.html")) {      if (open (HTML, ">$config{'htmldir'}/$l.html")) {
272          printf HTML "<html><head><title>%s: %s</title></head><body bgcolor=#ffffff>\n", $config{'title'}, ucfirst $lang;          printf HTML "<html><head><title>%s: %s</title></head><body bgcolor=#ffffff>\n", $config{'title'}, ucfirst $lang;

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.5