tags 192222 + patch
thanks

On Wed, May 07, 2003 at 02:27:25AM +0200, Denis Barbier wrote:
> On Wed, May 07, 2003 at 01:27:13AM +0200, Frank Lichtenheld wrote:
> > Package: www.debian.org
> > Version: N/A; reported 2003-05-07
> > Severity: minor
> > 
> > One (better three) example(s) for files, that are translated, but not 
> > checked 
> > by stattrans.pl are the international/l10n/*/tmpl.src files.
> > The problem is obvious: they do not end in .wml
> > Since the suffix .wml is hardcoded at several places in stattrans.pl 
> > (a quick check reveals at least four times), I can't provide a quick fix 
> > for this, so just reporting ;)
> 
> This patch should work, but I did not fully check.

Attached a more tested, extended patch.

Gruß,
-- 
*** Frank Lichtenheld <[EMAIL PROTECTED]> ***
          *** http://www.djpig.de/ ***
see also: - http://www.usta.de/
          - http://fachschaft.physik.uni-karlsruhe.de/
Index: stattrans.pl
===================================================================
RCS file: /cvs/webwml/webwml/stattrans.pl,v
retrieving revision 1.56
diff -u -r1.56 stattrans.pl
--- stattrans.pl        30 Apr 2003 10:41:46 -0000      1.56
+++ stattrans.pl        7 May 2003 22:10:33 -0000
@@ -31,7 +31,7 @@
 
 $opt_h = "/org/www.debian.org/www/devel/website/stats";
 $opt_w = "/org/www.debian.org/webwml";
-$opt_p = "*.wml";
+$opt_p = "*.(wml|src)";
 $opt_t = "Debian web site translation statistics";
 $opt_v = 0;
 $opt_d = "u";
@@ -113,10 +113,9 @@
     foreach my $f (@listfiles) {
        $file = substr ($f, $cutfrom);
        next if $transignore->is_global($file);
-       $file =~ s/\.wml$//;
        $files{$file} = 1;
        $wmlfiles{$lang} .= " " . $file;
-       my $transcheck = Webwml::TransCheck->new("$dir/$file.wml");
+       my $transcheck = Webwml::TransCheck->new("$dir/$file");
        if ($transcheck->revision()) {
            $transversion{"$lang/$file"} = $transcheck->revision();
            $original{"$lang/$file"} ||= $transcheck->original();
@@ -275,34 +274,40 @@
                $msg = check_translation ($transversion{"$lang/$file"}, 
$version{"$orig/$file"}, "$lang/$file");
                if (length ($msg)) {
                        $o_body .= "<tr>";
-                       if ($file eq "devel/wnpp/wnpp") {
-                               $o_body .= sprintf "<td>%s</td>", $file;
+                       if (($file !~ /\.wml$/) 
+                           || ($file eq "devel/wnpp/wnpp.wml")) {
+                           $o_body .= sprintf "<td>%s</td>", $file;
                        } else {
-                               $o_body .= sprintf "<td><a 
href=\"/%s.%s.html\">%s</a></td>", $file, $l, $file;
+                           (my $base = $file) =~ s/\.wml$//;
+                           $o_body .= sprintf "<td><a 
href=\"/%s.%s.html\">%s</a></td>", $base, $l, $base;
                        }
                        $o_body .= sprintf "<td>%s</td>", 
$transversion{"$lang/$file"};
                        $o_body .= sprintf "<td>%s</td>", 
$version{"$orig/$file"};
                        $o_body .= sprintf "<td>%s</td>", $msg;
-                       $o_body .= sprintf "<td>&nbsp;&nbsp;<a 
href=\"http://cvs.debian.org/webwml/$orig/%s.wml.diff\?r1=%s\&amp;r2=%s\&amp;cvsroot=webwml\&amp;diff_format=%s\";>%s
 -> %s</a></td>", $file, $transversion{"$lang/$file"}, $version{"$orig/$file"}, 
$config{'difftype'}, $transversion{"$lang/$file"}, $version{"$orig/$file"};
-                       $o_body .= sprintf "<td><a 
href=\"http://cvs.debian.org/webwml/$orig/%s.wml?cvsroot=webwml#rev%s\";>[L]</a></td>",
 $file, $version{"$orig/$file"};
+                       $o_body .= sprintf "<td>&nbsp;&nbsp;<a 
href=\"http://cvs.debian.org/webwml/$orig/%s.diff\?r1=%s\&amp;r2=%s\&amp;cvsroot=webwml\&amp;diff_format=%s\";>%s
 -> %s</a></td>", $file, $transversion{"$lang/$file"}, $version{"$orig/$file"}, 
$config{'difftype'}, $transversion{"$lang/$file"}, $version{"$orig/$file"};
+                       $o_body .= sprintf "<td><a 
href=\"http://cvs.debian.org/webwml/$orig/%s?cvsroot=webwml#rev%s\";>[L]</a></td>",
 $file, $version{"$orig/$file"};
                        $o_body .= sprintf "<td align=center>%s</td>", 
$maintainer{"$lang/$file"} || "";
                        $o_body .= "</tr>\n";
                        $outdated{$lang}++;
                # Up-to-date translations
                } else {
-                       if ($file eq "devel/wnpp/wnpp") {
-                               $t_body .= sprintf "%s<br>\n", $file;
+                       if (($file !~ /\.wml$/) 
+                           || ($file eq "devel/wnpp/wnpp.wml")) {
+                           $t_body .= sprintf "%s<br>\n", $file;
                        } else {
-                               $t_body .= sprintf "<a 
href=\"/%s.%s.html\">%s</a><br>\n", $file, $l, $file;
+                           (my $base = $file) =~ s/\.wml$//;
+                           $t_body .= sprintf "<a 
href=\"/%s.%s.html\">%s</a><br>\n", $base, $l, $base;
                        }
                }
        }
        # Untranslated pages
        else {
-               if ($file eq "devel/wnpp/wnpp") {
-                       $u_body .= sprintf "%s<br>\n", $file;
+               if (($file !~ /\.wml$/)
+                   || ($file eq "devel/wnpp/wnpp.wml")) {
+                   $u_body .= sprintf "%s<br>\n", $file;
                } else {
-                       $u_body .= sprintf "<a href=\"/%s\">%s</a><br>\n", 
$file, $file;
+                   (my $base = $file) =~ s/\.wml$//;
+                   $u_body .= sprintf "<a href=\"/%s\">%s</a><br>\n", $base, 
$base;
                }
                $untranslated{$lang}++;
        }

Reply via email to