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

Bug#616567: http://www.debian.org/devel/website/stats/de.html without spaces at edges



Le 08/03/2011 05:22, Tobias Quathamer a écrit :
> Hi David,

Hi Tobias,

> thanks for spotting this, the pages build fine now. However, could you
> log into www-master.d.o and remove the old (and now outdated) files
> $(LANGUAGE).html? They are still present, but are no longer refreshed.

Ho, I thought I checked that yesterday and that the links were created
gracefully. Anyway, don't know if someone beat me on this one, but thats
fixed now.

For what it's worth, please find attached the current WIP patch I used
to build the French index [0]. I'll continue in order to offer the
ability to build those stats in every supported language via a single PO
file (as a translator, I thought about doing that for quite some time).

	0: http://www.tilapin.org/debian/devel/website/stats/index.fr

I intend to create a website/devel/stats directory in each language and
handle the build à la sitemap, but if something smarter comes up, I
would be glad to try something else.

Regards

David

Index: stattrans.pl
===================================================================
RCS file: /cvsroot/webwml/webwml/stattrans.pl,v
retrieving revision 1.100
diff -u -r1.100 stattrans.pl
--- stattrans.pl	8 Mar 2011 06:23:20 -0000	1.100
+++ stattrans.pl	8 Mar 2011 13:44:38 -0000
@@ -45,7 +45,7 @@
 $opt_h = "/srv/www.debian.org/webwml/english/devel/website/stats";
 $opt_w = "/srv/www.debian.org/webwml";
 $opt_p = "*.(wml|src)";
-$opt_t = "Debian web site translation statistics";
+$opt_t = '<stats_title>';
 $opt_v = 0;
 $opt_d = "u";
 $opt_l = undef;
@@ -475,6 +475,7 @@
 
         if (open (HTML, ">$config{'htmldir'}/$l.wml")) {
 	    printf HTML "#use wml::debian::template title=\"%s\"\n", ucfirst $lang;
+	    print HTML "#use wml::debian::stats_tags\n";
 	    print HTML "#use wml::debian::toc\n\n";
             $color = get_color ($percent_a{$lang});
 
@@ -593,11 +594,13 @@
 open (HTMLI, ">$config{'htmldir'}/index.wml")
     || die "Can't open $config{'htmldir'}/index.wml";
 
+print HTMLI "#use wml::debian::stats_tags\n";
+print HTMLI "#use wml::debian::language_names\n";
 printf HTMLI "#use wml::debian::template title=\"%s\"\n\n", $config{'title'};
-print HTMLI "<h2>Translated web pages</h2>\n";
-printf HTMLI "<p>There are %d pages to translate.</p>\n",($wml{'english'}+$untranslated{'english'});
+print HTMLI '<h2><gettext domain="stats">Translated web pages</gettext></h2>'."\n";
+printf HTMLI "<p><stats_pages %d></p>\n",($wml{'english'}+$untranslated{'english'});
 
-print HTMLI "<table summary=\"Translation Statistics by Page Count\" class=\"stattrans\">\n";
+print HTMLI '<table summary="<gettext domain="stats">Translation Statistics by Page Count</gettext>" class="stattrans">'."\n";
 print HTMLI "<colgroup width=\"20%\">\n";
 print HTMLI "<col>\n";
 print HTMLI "</colgroup>";
@@ -612,7 +615,11 @@
 print HTMLI "<col width=\"10%\">\n";
 print HTMLI "</colgroup>";
 print HTMLI "<thead>";
-print HTMLI "<tr><th>Language</th><th colspan=\"2\">Translations</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Outdated</th><th colspan=\"2\">Not translated</th></tr>\n";
+print HTMLI '<tr><th><gettext domain="stats">Language</gettext></th>'."\n";
+print HTMLI '<th colspan="2"><gettext domain="stats">Translations</gettext></th>'."\n";
+print HTMLI '<th colspan="2"><gettext domain="stats">Up to date</gettext></th>'."\n";
+print HTMLI '<th colspan="2"><gettext domain="stats">Outdated</gettext></th>'."\n";
+print HTMLI '<th colspan="2"><gettext domain="stats">Not translated</gettext></th></tr>'."\n";
 print HTMLI "</thead>";
 print HTMLI "<tbody>";
 foreach $lang (@search_in) {
@@ -625,7 +632,7 @@
         $color_u = get_color (100 - $percent_u{$lang});
 
         print HTMLI "<tr>";
-        printf HTMLI "<th><a href=\"%s\">%s</a> (%s)</th>", $l, ucfirst $lang, $l;
+        printf HTMLI "<th><a href=\"%s\"><:=\$trans{\$CUR_ISO_LANG}{%s} :></a> (%s)</th>", $l, $lang, $l;
         printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%.1f%%)</td>", $color_a, $wml{$lang},          $percent_a{$lang};
         printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%.1f%%)</td>", $color_t, $translated{$lang},   $percent_t{$lang};
         printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%.1f%%)</td>", $color_o, $outdated{$lang},     $percent_o{$lang};
@@ -636,10 +643,10 @@
 print HTMLI "</tbody>";
 print HTMLI "</table>\n";
 
-print HTMLI "<h2>Translated web pages (by size)</h2>\n";
-printf HTMLI "<p>There are %d bytes to translate.</p>\n",($wml_s{'english'}+$untranslated_s{'english'});
+print HTMLI '<h2><gettext domain="stats">Translated web pages (by size)</gettext></h2>'."\n";
+printf HTMLI "<p><stats_bytes %d></p>\n",($wml_s{'english'}+$untranslated_s{'english'});
 
-print HTMLI "<table summary=\"Translation Statistics by Page Size\" class=\"stattrans\">\n";
+print HTMLI '<table summary="<gettext domain="stats">Translation Statistics by Page Size</gettext>" class="stattrans">'."\n";
 print HTMLI "<colgroup span=\"1\">\n";
 print HTMLI "<col width=\"20%\">\n";
 print HTMLI "</colgroup>";
@@ -654,7 +661,11 @@
 print HTMLI "<col width=\"7%\">\n";
 print HTMLI "</colgroup>";
 print HTMLI "<thead>";
-print HTMLI "<tr><th>Language</th><th colspan=\"2\">Translations</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Outdated</th><th colspan=\"2\">Not translated</th></tr>\n";
+print HTMLI '<tr><th><gettext domain="stats">Language</gettext></th>'."\n";
+print HTMLI '<th colspan="2"><gettext domain="stats">Translations</gettext></th>'."\n";
+print HTMLI '<th colspan="2"><gettext domain="stats">Up to date</gettext></th>'."\n";
+print HTMLI '<th colspan="2"><gettext domain="stats">Outdated</gettext></th>'."\n";
+print HTMLI '<th colspan="2"><gettext domain="stats">Not translated</gettext></th></tr>'."\n";
 print HTMLI "</thead>";
 print HTMLI "<tbody>";
 
@@ -668,7 +679,7 @@
 	$color_u = get_color (100 - $percent_u{$lang});
 
 	print HTMLI "<tr>";
-	printf HTMLI "<th><a href=\"%s\">%s</a> (%s)</th>", $l, ucfirst $lang, $l;
+	printf HTMLI "<th><a href=\"%s\"><:=\$trans{\$CUR_ISO_LANG}{%s} :></a> (%s)</th>", $l, $lang, $l;
 	printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%.1f%%)</td>", $color_a, $wml_s{$lang},                   $percent_as{$lang};
 	printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%.1f%%)</td>", $color_t, $translated_s{$lang},            $percent_ts{$lang};
 	printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%.1f%%)</td>", $color_o, $outdated_s{$lang},              $percent_os{$lang};
@@ -679,9 +690,10 @@
 print HTMLI "</tbody>";
 print HTMLI "</table>\n";
 
-print HTMLI "<h2>Translated templates (gettext files)</h2>\n";
-printf HTMLI "<p>There are %d strings to translate.</p>\n",$po_total{'total'};
-print HTMLI "<table summary=\"Gettext Translation Statistics\"class=\"stattrans\">\n";
+print HTMLI '<h2><gettext domain="stats">Translated templates (PO files)</gettext></h2>'."\n";
+printf HTMLI "<p><stats_strings %d></p>\n",$po_total{'total'};
+
+print HTMLI '<table summary="<gettext domain="stats">PO Translation Statistics</gettext>"class="stattrans">'."\n";
 print HTMLI "<colgroup span=\"1\"width=\"28%\">\n";
 print HTMLI "</colgroup>";
 print HTMLI "<colgroup span=\"6\" width=\"12%\">\n";
@@ -693,7 +705,10 @@
 print HTMLI "<col width=\"12%\">\n";
 print HTMLI "</colgroup>";
 print HTMLI "<thead>";
-print HTMLI "<tr><th>Language</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Fuzzy</th><th colspan=\"2\">Not translated</th></tr>\n";
+print HTMLI '<tr><th><gettext domain="stats">Language</gettext></th>'."\n";
+print HTMLI '<th colspan="2"><gettext domain="stats">Up to date</gettext></th>'."\n";
+print HTMLI '<th colspan="2"><gettext domain="stats">Fuzzy</gettext></th>'."\n";
+print HTMLI '<th colspan="2"><gettext domain="stats">Not translated</gettext></th></tr>'."\n";
 print HTMLI "</thead>";
 print HTMLI "<tbody>";
 foreach $lang (@search_in) {
@@ -702,7 +717,7 @@
     @processed_langs = ("zh-cn", "zh-tw") if $langs{$lang} eq "zh";
     foreach $l (@processed_langs) {
         print HTMLI "<tr>";
-        printf HTMLI "<th><a href=\"%s#gettext\">%s</a> (%s)</th>", $l, ucfirst $lang, $l;
+        printf HTMLI "<th><a href=\"%s#gettext\"><:=\$trans{\$CUR_ISO_LANG}{%s} :></a> (%s)</th>", $l, $lang, $l;
         $color_t = get_color ($percent_po_t{'total'}{$lang});
         $color_f = get_color (100 - $percent_po_f{'total'}{$lang});
         $color_u = get_color (100 - $percent_po_u{'total'}{$lang});
@@ -716,7 +731,7 @@
 print HTMLI "</tbody>";
 print HTMLI "</table>\n";
 
-print HTMLI "<address>Created with <a href=\"http://alioth.debian.org/scm/viewvc.php/webwml/stattrans.pl?view=markup\&amp;root=webwml\";>webwml-stattrans</a></address>\n";
+print HTMLI '<address><gettext domain="stats">Created with</gettext> <a href="http://alioth.debian.org/scm/viewvc.php/webwml/stattrans.pl?view=markup&amp;root=webwml";>webwml-stattrans</a></address>'."\n";
 close (HTMLI);
 
 print "done.\n" if ($config{'verbose'});

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: