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

[RFC] website translation stats: split untranslated pages



Hi all,

I've created a patch for the stattrans.pl script which creates the pages 
with translation statistics for the website. This patch will split the 
overview of untranslated pages into 3 categories:
- Pages not translated (general pages)
- News items not translated
- Consultant/user pages not translated

The reason for the patch is that for new languages and for languages that 
have only partially translated the website, the current list of 
untranslated pages can be extremely long and it can be especially 
difficult to find new pages that could be worth translating in that list.

IMHO the categories of pages I've split out with this page will often have 
a lower priority with translators than more general pages. For languages 
that keep up with news items, the split will make it easier to spot when 
there are new ones.

See the example page linked below for how the split works out. Note that I 
have left the yearly index pages for news items in the general category.
An option would be to also split out the language-specific "international" 
pages into a separate category.

A preview of how the new page would look for Dutch is here:
http://people.debian.org/~fjp/www-stats_nl.html
The current page for Dutch looks like this:
http://www.debian.org/devel/website/stats/nl.html

I'd appreciate your comments before the patch is committed.

Cheers,
FJP

Index: stattrans.pl
===================================================================
RCS file: /cvs/webwml/webwml/stattrans.pl,v
retrieving revision 1.78
diff -u -r1.78 stattrans.pl
--- stattrans.pl	13 Mar 2006 13:37:26 -0000	1.78
+++ stattrans.pl	21 Jan 2007 02:07:27 -0000
@@ -272,7 +272,7 @@
     foreach $l (@processed_langs) {
         print "$l.html " if ($config{'verbose'});
 
-        $t_body = $u_body = $o_body = "";
+        $t_body = $u_body = $un_body = $uu_body = $o_body = "";
         $translated{$lang} = $outdated{$lang} = $untranslated{$lang} = 0;
 
         # get stats about files
@@ -320,13 +320,24 @@
             }
             # Untranslated pages
             else {
+	        my $u_tmp;
                 if (($file !~ /\.wml$/)
                     || ($file eq "devel/wnpp/wnpp.wml")) {
-                    $u_body .= sprintf "<tr><td>%s</td><td>&nbsp;</td></tr>\n", $file;
+                    $u_tmp = sprintf "<tr><td>%s</td><td>&nbsp;</td></tr>\n", $file;
                 } else {
                     (my $base = $file) =~ s/\.wml$//;
-                    $u_body .= sprintf "<tr><td><a href=\"$opt_b/%s\">%s</a></td><td align=\"right\">%d</td><td>(%.2f&nbsp;&permil;)</td></tr>\n", $base, $base, $sizes{$file}, $sizes{$file}/$nsize * 1000;
+                    $u_tmp = sprintf "<tr><td><a href=\"$opt_b/%s\">%s</a></td><td align=\"right\">%d</td><td>(%.2f&nbsp;&permil;)</td></tr>\n", $base, $base, $sizes{$file}, $sizes{$file}/$nsize * 1000;
                 }
+		if ((($file =~ /(News|events|security|vote)\/[0-9]{4}\//) &&
+		     ($file !~ /index.wml$/)) ||
+		    ($file =~ /(News\/weekly\/[0-9]{4}\/|security\/undated)/)) {
+		    $un_body .= $u_tmp;
+		} elsif (($file =~ /(consultants|users\/(com|edu|gov|org))\//) &&
+		         ($file !~ /index.wml$/)) {
+		    $uu_body .=$u_tmp;
+		} else {
+		    $u_body .= $u_tmp;
+		}
                 $untranslated{$lang}++;
 		$untranslated_s{$lang} += $sizes{$file};
             }
@@ -407,6 +418,12 @@
             if ($u_body) {
                 print HTML "<li><a href=\"#untranslated\">Pages not translated</a></li>\n";
             }
+            if ($un_body) {
+                print HTML "<li><a href=\"#untranslated-news\">News items not translated</a></li>\n";
+            }
+            if ($uu_body) {
+                print HTML "<li><a href=\"#untranslated-user\">Consultant/user pages not translated</a></li>\n";
+            }
             if ($t_body) {
                 print HTML "<li><a href=\"#uptodate\">Translations up to date</a></li>\n";
             }
@@ -435,6 +452,18 @@
                 print HTML $u_body;
 		print HTML "</table>\n";
             }
+            if ($un_body) {
+                print HTML "<h3><a name='untranslated-news'>News items not translated</a>: <a href='#top'>(top)</a></h3>\n";
+		print HTML "<table summary=\"Untranslated news items\">\n";
+                print HTML $un_body;
+		print HTML "</table>\n";
+            }
+            if ($uu_body) {
+                print HTML "<h3><a name='untranslated-user'>Consultant/user pages not translated</a>: <a href='#top'>(top)</a></h3>\n";
+		print HTML "<table summary=\"Untranslated consultant/user pages\">\n";
+                print HTML $uu_body;
+		print HTML "</table>\n";
+            }
             if ($t_body) {
                 print HTML "<h3><a name='uptodate'>Translations up to date</a>: <a href='#top'>(top)</a></h3>\n";
 		print HTML "<ul class=\"discless\">\n";

Attachment: pgp_lZLFm_bwH.pgp
Description: PGP signature


Reply to: