[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#256891: marked as done (www.debian.org: add stats on bytes to translated in devel/website/stats)



Your message dated Mon, 12 Sep 2005 21:36:21 +0200
with message-id <20050912193621.GA4093@free.fr>
and subject line Bug#256891: www.debian.org: add stats on bytes to translated in devel/website/stats
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 29 Jun 2004 18:11:11 +0000
>From nico.bertol@free.fr Tue Jun 29 11:11:11 2004
Return-path: <nico.bertol@free.fr>
Received: from postfix3-2.free.fr [213.228.0.169] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1BfN4Z-0003yq-00; Tue, 29 Jun 2004 11:11:11 -0700
Received: from bertol (europe-1-82-227-82-133.fbx.proxad.net [82.227.82.133])
	by postfix3-2.free.fr (Postfix) with ESMTP id 9ACAEC1C3
	for <submit@bugs.debian.org>; Tue, 29 Jun 2004 20:11:09 +0200 (CEST)
Received: from nico by bertol with local (Exim 3.35 #1 (Debian))
	id 1BfN4W-0003ME-00; Tue, 29 Jun 2004 20:11:08 +0200
Date: Tue, 29 Jun 2004 20:11:08 +0200
From: Nicolas Bertolissio <nico.bertol@free.fr>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: www.debian.org: add stats on bytes to translated in devel/website/stats
Message-ID: <20040629181108.GA12904@free.fr>
Mail-Followup-To: Nicolas Bertolissio <nico.bertol@free.fr>,
	Debian Bug Tracking System <submit@bugs.debian.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="+g7M9IMkV8truYOl"
Content-Disposition: inline
X-Reportbug-Version: 2.61
User-Agent: Mutt/1.5.6+20040523i
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
	version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 


--+g7M9IMkV8truYOl
Content-Type: multipart/mixed; boundary="pf9I7BMVVzbSWLtt"
Content-Disposition: inline


--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Package: www.debian.org
Severity: wishlist
Tags: patch

Hi,

here is a patch that add statistics about bytes to translate, I think it
gives a good idea of the amount of work to be done as big pages are
longer to translate than small ones.

regards


Nicolas Bertolissio

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.6
Locale: LANG=3Dfr_FR@euro, LC_CTYPE=3Dfr_FR@euro

--=20

--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="stattrans.0.pl.diff"
Content-Transfer-Encoding: quoted-printable

--- stattrans.0.pl	2004-06-29 19:52:19.000000000 +0200
+++ stattrans.1.pl	2004-06-29 19:55:16.000000000 +0200
@@ -88,6 +88,7 @@
 my %transversion;
 my %version;
 my %files;
+my %sizes;
=20
 # Count wml files in given directory
 #
@@ -97,6 +98,7 @@
     my $dir =3D "$config{'wmldir'}/$lang";
     my $cutfrom =3D length ($config{'wmldir'})+length($lang)+2;
     my $count =3D 0;
+    my $size =3D 0;
     my $is_english =3D ($lang eq "english")?1:0;
     my ( $file, $v );
     my @listfiles;
@@ -133,9 +135,12 @@
 	    $maintainer{"$lang/$file"} =3D $transcheck->maintainer();
 	}
 	$count++;
+	$sizes{$file} =3D (stat "".($original{"english/$file"}||"english")."/".$f=
ile)[7];
+	$size +=3D $sizes{$file};
     }
     $wmlfiles{$lang} .=3D " ";
     $wml{$lang} =3D $count;
+    $wml_s{$lang} =3D $size;
 }
=20
 sub get_color
@@ -253,6 +258,8 @@
=20
 my @filenames =3D sort keys %files;
 my $nfiles =3D scalar @filenames;
+my $nsize;
+$nsize +=3D $sizes{$_} foreach (@filenames);
=20
 print "Creating files: " if ($config{'verbose'});
 foreach $lang (@search_in) {
@@ -269,6 +276,7 @@
             # Translated pages
             if (index ($wmlfiles{$lang}, " $file ") >=3D 0) {
                 $translated{$lang}++;
+		$translated_s{$lang} +=3D $sizes{$file};
                 $orig =3D $original{"$lang/$file"} || "english";
                 # Outdated translations
                 $msg =3D check_translation ($transversion{"$lang/$file"}, =
$version{"$orig/$file"}, "$lang/$file");
@@ -289,6 +297,7 @@
                     $o_body .=3D sprintf "<td align=3Dcenter>%s</td>", $ma=
intainer{"$lang/$file"} || "";
                     $o_body .=3D "</tr>\n";
                     $outdated{$lang}++;
+		    $outdated_s{$lang} +=3D $sizes{$file};
                 # Up-to-date translations
                 } else {
                     if (($file !~ /\.wml$/)=20
@@ -310,6 +319,7 @@
                     $u_body .=3D sprintf "<a href=3D\"/%s\">%s</a><br>\n",=
 $base, $base;
                 }
                 $untranslated{$lang}++;
+		$untranslated_s{$lang} +=3D $sizes{$file};
             }
         }
        =20
@@ -318,20 +328,28 @@
         # but which don't exist in the English directory
         #   print "extra files: ".$wml{$lang}-$translated{$lang}."\n";
         $wml{$lang} =3D $translated{$lang};
+	$wml_s{$lang} =3D $translated_s{$lang};
         $translated{$lang} =3D $translated{$lang} - $outdated{$lang};
+	$translated_s{$lang} =3D $translated_s{$lang} - $outdated_s{$lang};
    =20
         if ($nfiles > 0) {
             $percent_a{$lang} =3D int ($wml{$lang}/$nfiles * 100 + .5);
+	    $percent_as{$lang} =3D int ($wml_s{$lang}/$nsize * 100 + .5);
         } else {
             $percent_a{$lang} =3D 0;
+	    $percent_as{$lang} =3D 0;
         }
         if ($wml{$lang} > 0) {
             $percent_t{$lang} =3D int ($translated{$lang}/$wml{$lang} * 10=
0 + .5);
+	    $percent_ts{$lang} =3D int ($translated_s{$lang}/($wml_s{$lang}+1) * =
100 + .5);
         } else {
             $percent_t{$lang} =3D 0;
+	    $percent_ts{$lang} =3D 0;
         }
         $percent_o{$lang} =3D 100 - $percent_t{$lang};
+	$percent_os{$lang} =3D 100 - $percent_ts{$lang};
         $percent_u{$lang} =3D 100 - $percent_a{$lang};
+	$percent_us{$lang} =3D 100 - $percent_as{$lang};
    =20
         if (open (HTML, ">$config{'htmldir'}/$l.html")) {
             printf HTML "<html><head><title>%s: %s</title></head><body bgc=
olor=3D\"#ffffff\">\n", $config{'title'}, ucfirst $lang;
@@ -349,6 +367,12 @@
             printf HTML "<td align=3D\"center\" width=3D\"25%%\"><b>%d fil=
es (%d%%) outdated</b></td>", $outdated{$lang}, $percent_o{$lang};
             printf HTML "<td align=3D\"center\" width=3D\"25%%\"><b>%d fil=
es (%d%%) not translated</b></td>", $untranslated{$lang}, $percent_u{$lang};
             print HTML "</tr>\n";
+	    print HTML "<tr>\n";
+	    printf HTML "<td align=3D\"center\" width=3D\"25%%\"><b>%d bytes (%d%=
%) translated</b></td>", $wml_s{$lang}, $percent_as{$lang};
+	    printf HTML "<td align=3D\"center\" width=3D\"25%%\"><b>%d bytes (%d%=
%) up to date</b></td>", $translated_s{$lang}, $percent_ts{$lang};
+	    printf HTML "<td align=3D\"center\" width=3D\"25%%\"><b>%d bytes (%d%=
%) outdated</b></td>", $outdated_s{$lang}, $percent_os{$lang};
+	    printf HTML "<td align=3D\"center\" width=3D\"25%%\"><b>%d bytes (%d%=
%) not translated</b></td>", $nsize-$wml_s{$lang}, $percent_us{$lang};
+	    print HTML "</tr>\n";
             print HTML "</table>\n";
    =20
             # Make the table of content
@@ -469,6 +493,34 @@
 print HTML "</table>\n";
 print HTML $border_foot;
=20
+print HTML "<h2>Translated web pages (by size)</h2>\n";
+printf HTML "<p>There are %d bytes to translate.</p>\n",($wml_s{'english'}=
+$untranslated_s{'english'});
+
+print HTML $border_head;
+print HTML "<table width=3D\"100%\" border=3D0 bgcolor=3D\"#cdc9c9\">\n";
+print HTML "<tr><th>Language</th><th colspan=3D\"2\">Translations</th><th =
colspan=3D\"2\">Up to date</th><th colspan=3D\"2\">Outdated</th><th colspan=
=3D\"2\">Not translated</th></tr>\n";
+
+foreach $lang (@search_in) {
+    my @processed_langs =3D ($langs{$lang});
+    @processed_langs =3D ("zh-cn", "zh-tw") if $langs{$lang} eq "zh";
+    foreach $l (@processed_langs) {
+	$color_a =3D get_color ($percent_a{$lang});
+	$color_t =3D get_color ($percent_t{$lang});
+	$color_o =3D get_color (100 - $percent_o{$lang});
+	$color_u =3D get_color (100 - $percent_u{$lang});
+
+	print HTML "<tr>";
+	printf HTML "<td><a href=3D\"%s.html\">%s</a> (%s)</td>", $l, ucfirst $la=
ng, $l;
+	printf HTML "<td bgcolor=3D\"%s\" align=3Dright>%d</td><td>(%d%%)</td>", =
$color_a, $wml_s{$lang}, $percent_as{$lang};
+	printf HTML "<td bgcolor=3D\"%s\" align=3Dright>%d</td><td>(%d%%)</td>", =
$color_t, $translated_s{$lang}, $percent_ts{$lang};
+	printf HTML "<td bgcolor=3D\"%s\" align=3Dright>%d</td><td>(%d%%)</td>", =
$color_o, $outdated_s{$lang}, $percent_os{$lang};
+	printf HTML "<td bgcolor=3D\"%s\" align=3Dright>%d</td><td>(%d%%)</td>", =
$color_u, $wml_s{"english"}-$wml_s{$lang}, $percent_us{$lang};
+	print HTML "</tr>\n";
+    }
+}
+print HTML "</table>\n";
+print HTML $border_foot;
+
 print HTML "<h2>Translated templates (gettext files)</h2>\n";
 printf HTML "<p>There are %d strings to translate.</p>\n",$po_total{'total=
'};
 print HTML $border_head;

--pf9I7BMVVzbSWLtt--

--+g7M9IMkV8truYOl
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA4bC8PnQ0OX3ZAY0RAvDQAJwNaQ4r1nGrrHEEbJ7RBvxBNzJSuACgmGDO
6dqtaA225lPOCQnFIcC4tp0=
=zSML
-----END PGP SIGNATURE-----

--+g7M9IMkV8truYOl--

---------------------------------------
Received: (at 256891-done) by bugs.debian.org; 12 Sep 2005 19:36:24 +0000
>From nico.bertol@free.fr Mon Sep 12 12:36:24 2005
Return-path: <nico.bertol@free.fr>
Received: from smtp1-g19.free.fr [212.27.42.27] 
	by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
	id 1EEu6K-0006TQ-00; Mon, 12 Sep 2005 12:36:24 -0700
Received: from bertol (eur68-1-82-227-82-133.fbx.proxad.net [82.227.82.133])
	by smtp1-g19.free.fr (Postfix) with ESMTP id E7A432F503
	for <256891-done@bugs.debian.org>; Mon, 12 Sep 2005 21:36:21 +0200 (CEST)
Received: from nico by bertol with local (Exim 3.35 #1 (Debian))
	id 1EEu6H-00014E-00
	for <256891-done@bugs.debian.org>; Mon, 12 Sep 2005 21:36:21 +0200
Date: Mon, 12 Sep 2005 21:36:21 +0200
From: Nicolas Bertolissio <nico.bertol@free.fr>
To: 256891-done@bugs.debian.org
Subject: Re: Bug#256891: www.debian.org: add stats on bytes to translated in devel/website/stats
Message-ID: <20050912193621.GA4093@free.fr>
Mail-Followup-To: Nicolas Bertolissio <nico.bertol@free.fr>,
	256891-done@bugs.debian.org
References: <20040629181108.GA12904@free.fr> <20040629183825.GJ2079@djpig.de> <[🔎] 20050911072035.GA17805@itp.uni-hannover.de> <[🔎] 20050911083237.GB32580@djpig.de> <[🔎] 20050911205838.GA3882@free.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
In-Reply-To: <[🔎] 20050911205838.GA3882@free.fr>
User-Agent: Mutt/1.5.9i
Content-Transfer-Encoding: quoted-printable
Delivered-To: 256891-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

Le dimanche 11 septembre 2005, Nicolas Bertolissio =E9crit :
> Hi,
>=20
> Le dimanche 11 septembre 2005, Frank Lichtenheld =E9crit :
> > Feel free to test and commit the patch, I don't object.
>=20
> Here is the new updated patch, for the record
> I'm commiting it now

It works fine, so this bug is closed


Nicolas
--



Reply to: