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

Contents of /webwml/stattrans.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.51 - (hide annotations) (download)
Fri Nov 29 09:20:45 2002 UTC (10 years, 5 months ago) by french
Branch: MAIN
Changes since 1.50: +3 -2 lines
File MIME type: text/plain
Repports about how many pages (or gettext strings) are to be translated
1 joy 1.1 #! /usr/bin/perl
2    
3 joy 1.38 # webwml-stattrans - Debian web site translation statistics
4 joy 1.1 # Copyright (c) 2001 Martin Schulze <joey@debian.org> and others
5    
6     # This program is free software; you can redistribute it and/or modify
7     # it under the terms of the GNU General Public License as published by
8     # the Free Software Foundation; either version 2 of the License, or
9     # (at your option) any later version.
10    
11     # This program is distributed in the hope that it will be useful,
12     # but WITHOUT ANY WARRANTY; without even the implied warranty of
13     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     # GNU General Public License for more details.
15    
16     # You should have received a copy of the GNU General Public License
17     # along with this program; if not, write to the Free Software
18 joy 1.6 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 joy 1.1
20     use POSIX qw(strftime);
21 joy 1.6 use Getopt::Std;
22 barbier 1.24
23     # These modules reside under webwml/Perl
24     use lib ($0 =~ m|(.*)/|, $1 or ".") ."/Perl";
25     use Local::Cvsinfo;
26     use Webwml::Langs;
27     use Webwml::TransCheck;
28     use Webwml::TransIgnore;
29    
30 joy 1.7 $| = 1;
31 joy 1.1
32 joy 1.37 $opt_h = "/org/www.debian.org/www/devel/website/stats";
33 joy 1.6 $opt_w = "/org/www.debian.org/webwml";
34     $opt_p = "*.wml";
35 joy 1.38 $opt_t = "Debian web site translation statistics";
36 joy 1.6 $opt_v = 0;
37 joy 1.12 $opt_d = "u";
38 joy 1.14 $opt_l = undef;
39 joy 1.34 getopts('h:w:p:t:vd:l:') || die;
40 barbier 1.24 # Replace filename globbing by Perl regexps
41     $opt_p =~ s/\,/\\./g;
42     $opt_p =~ s/\?/./g;
43     $opt_p =~ s/\*/.*/g;
44     $opt_p =~ s/$/\$/g;
45 joy 1.1 %config = (
46 joy 1.6 'htmldir' => $opt_h,
47     'wmldir' => $opt_w,
48     'wmlpat' => $opt_p,
49     'title' => $opt_t,
50     'verbose' => $opt_v,
51 joy 1.36 'difftype'=> $opt_d,
52 joy 1.1 );
53    
54 barbier 1.24 my $l = Webwml::Langs->new($opt_w);
55     my %langs = $l->name_iso();
56    
57     my $transignore = Webwml::TransIgnore->new($opt_w);
58    
59     my $cvs = Local::Cvsinfo->new();
60     $cvs->options(
61     recursive => 1,
62     matchfile => [ $config{'wmlpat'} ],
63     skipdir => [ "template" ],
64     );
65     $cvs->readinfo("$config{'wmldir'}/english");
66     foreach (@{$transignore->global()}) {
67     $cvs->removefile("$config{'wmldir'}/english/$_");
68     }
69    
70     my $altcvs = Local::Cvsinfo->new();
71     $altcvs->options(
72     recursive => 1,
73     matchfile => [ $config{'wmlpat'} ],
74     skipdir => [ "template" ],
75     );
76    
77 joy 1.1 $max_versions = 5;
78     $min_versions = 1;
79    
80 barbier 1.41 $border_head = "<table width=\"95%\" align=\"center\" border=0 cellpadding=0 cellspacing=0><tr bgcolor=\"#000000\"><td>"
81     ."<table width=\"100%\" border=0 cellpadding=0 cellspacing=1><tr bgcolor=\"#ffffff\"><td>";
82 joy 1.1 $border_foot = "</td></tr></table></td></tr></table>";
83    
84    
85     $date = strftime "%a %b %e %H:%M:%S %Y %z", localtime;
86    
87 barbier 1.24 my %original;
88 barbier 1.25 my %transversion;
89     my %version;
90 kraai 1.27 my %files;
91 joy 1.1
92     # Count wml files in given directory
93     #
94     sub getwmlfiles
95     {
96     my $lang = shift;
97 joy 1.14 my $dir = "$config{'wmldir'}/$lang";
98 joy 1.1 my $cutfrom = length ($config{'wmldir'})+length($lang)+2;
99     my $count = 0;
100     my $is_english = ($lang eq "english")?1:0;
101     my $file, $v;
102 barbier 1.24 my @listfiles;
103 joy 1.1
104 joy 1.7 print "$lang " if ($config{verbose});
105 joy 1.14 die "$0: can't find $dir!\n" if (! -d "$dir");
106 barbier 1.24 if ($is_english) {
107     @listfiles = @{$cvs->files()};
108     } else {
109     $altcvs->reset();
110     $altcvs->readinfo($dir);
111     @listfiles = @{$altcvs->files()};
112     }
113     foreach my $f (@listfiles) {
114     $file = substr ($f, $cutfrom);
115     next if $transignore->is_global($file);
116 joy 1.1 $file =~ s/\.wml$//;
117 kraai 1.27 $files{$file} = 1;
118 joy 1.7 $wmlfiles{$lang} .= " " . $file;
119 barbier 1.24 my $transcheck = Webwml::TransCheck->new("$dir/$file.wml");
120 barbier 1.25 if ($transcheck->revision()) {
121     $transversion{"$lang/$file"} = $transcheck->revision();
122     $original{"$lang/$file"} ||= $transcheck->original();
123     }
124 joy 1.1 if ($is_english) {
125 barbier 1.25 $version{"$lang/$file"} = $cvs->revision($f);
126     } else {
127     $version{"$lang/$file"} = $altcvs->revision($f);
128     if (!$transcheck->revision()) {
129     $original{"english/$file"} = $lang;
130 kraai 1.28 $transversion{"english/$file"} ||= "1.1";
131 barbier 1.24 }
132 joy 1.1 }
133 french 1.50 if ($transcheck->maintainer()) {
134     $maintainer{"$lang/$file"} = $transcheck->maintainer();
135     }
136 joy 1.1 $count++;
137     }
138     close (FIND);
139 joy 1.7 $wmlfiles{$lang} .= " ";
140     $wml{$lang} = $count;
141 barbier 1.25 }
142 joy 1.1
143     sub get_color
144     {
145     my $percent = shift;
146    
147 kraai 1.17 if ($percent < 50) {
148     return sprintf ("#FF%02x00", (255/50) * $percent);
149 joy 1.1 } else {
150 kraai 1.17 return sprintf ("#%02xFF00", (255/50) * (100 - $percent));
151 joy 1.1 }
152     }
153    
154     sub check_translation
155     {
156     my ($translation, $version, $file) = @_;
157     my @version_numbers, $major_number, $last_number;
158     my @translation_numbers, $major_translated_number, $last_translated_number;
159    
160     if ($version ne "" && $translation ne "") {
161     @version_numbers = split /\./,$version;
162     $major_number = @version_numbers[0];
163     $last_number = pop @version_numbers;
164     die "Invalid CVS revision for $file: $version\n"
165     unless ($major_number =~ /\d+/ && $last_number =~ /\d+/);
166    
167     @translation_numbers = split /\./,$translation;
168     $major_translated_number = @translation_numbers[0];
169     $last_translated_number = pop @translation_numbers;
170     die "Invalid translation revision for $file: $translation\n"
171     unless ($major_translated_number =~ /\d+/ && $last_translated_number =~ /\d+/);
172    
173     # Here we compare the original version with the translated one and print
174     # a note for the user if their first or last numbers are too far apart
175     # From translation-check.wml
176    
177     if ($version eq "") {
178     return "The original no longer exists";
179     } elsif ( $major_number != $major_translated_number ) {
180     return "This translation is too out of date";
181     } elsif ( $last_number - $last_translated_number >= $max_versions ) {
182     return "This translation is too out of date";
183     } elsif ( $last_number - $last_translated_number >= $min_versions ) {
184     return "The original is newer than this translation";
185     }
186     }
187     return "";
188     }
189    
190 joy 1.7 print "Collecting data in: " if ($config{'verbose'});
191 joy 1.14 if ($opt_l) {
192 barbier 1.24 getwmlfiles ($opt_l);
193 joy 1.14 getwmlfiles ('english');
194     } else {
195     foreach $lang (keys %langs) {
196 joy 1.7 getwmlfiles ($lang);
197 joy 1.14 }
198 joy 1.1 }
199     print "\n" if ($config{'verbose'});
200    
201 barbier 1.40 my @search_in;
202     if ($opt_l) {
203     @search_in = ( 'english', $opt_l );
204     } else {
205     @search_in = sort keys %langs;
206     }
207    
208 french 1.43 # Compute stats about gettext files
209 joy 1.45 print "Computing statistics in gettext files... " if ($config{'verbose'});
210 french 1.43 my %po_translated,%po_fuzzy,%po_untranslated,%po_total;
211     my %percent_po_t,%percent_po_u,%percent_po_f;
212 barbier 1.40 foreach $lang (@search_in) {
213     next if $lang eq 'english';
214     $l = $langs{$lang};
215 french 1.43 $po_translated{"total"}{$lang} = $po_fuzzy{"total"}{$lang} = $po_untranslated{"total"}{$lang} = 0;
216     my @status = qx,LC_ALL=C make -C $opt_w/$lang/po stats 2>&1 1>/dev/null,;
217 barbier 1.40 foreach $line (@status) {
218     chomp $line;
219     ($domain = $line) =~ s/\..*//;
220     $po_translated{$domain}{$lang} = ($line =~ /(\d+) translated/ ? $1 : "0");
221     $po_fuzzy{$domain}{$lang} = ($line =~ /(\d+) fuzzy/ ? $1 : "0");
222     $po_untranslated{$domain}{$lang} = ($line =~ /(\d+) untranslated/ ? $1 : "0");
223 french 1.43
224 barbier 1.40 $po_total{$domain} = $po_translated{$domain}{$lang} + $po_fuzzy{$domain}{$lang} + $po_untranslated{$domain}{$lang};
225 french 1.43
226     $po_translated{"total"}{$lang} += $po_translated{$domain}{$lang};
227     $po_fuzzy{"total"}{$lang} += $po_fuzzy{$domain}{$lang};
228     $po_untranslated{"total"}{$lang} += $po_untranslated{$domain}{$lang};
229    
230 barbier 1.42 if ($po_total{$domain} > 0) {
231     $percent_po_t{$domain}{$lang} = int ($po_translated{$domain}{$lang}/$po_total{$domain} * 100 + .5);
232     $percent_po_f{$domain}{$lang} = int ($po_fuzzy{$domain}{$lang}/$po_total{$domain} * 100 + .5);
233     $percent_po_u{$domain}{$lang} = int ($po_untranslated{$domain}{$lang}/$po_total{$domain} * 100 + .5);
234     } else {
235     $percent_po_t{$domain}{$lang} = 0;
236     $percent_po_f{$domain}{$lang} = 0;
237     $percent_po_u{$domain}{$lang} = 0;
238     }
239 barbier 1.40 }
240 french 1.43 $po_total{"total"} = $po_translated{"total"}{$lang} + $po_fuzzy{"total"}{$lang} + $po_untranslated{"total"}{$lang};
241    
242     if ($po_total{'total'} > 0) {
243     $percent_po_t{'total'}{$lang} = int ($po_translated{'total'}{$lang}/$po_total{'total'} * 100 + .5);
244     $percent_po_f{'total'}{$lang} = int ($po_fuzzy{'total'}{$lang}/$po_total{'total'} * 100 + .5);
245     $percent_po_u{'total'}{$lang} = int ($po_untranslated{'total'}{$lang}/$po_total{'total'} * 100 + .5);
246     } else {
247     $percent_po_t{'total'}{$lang} = 0;
248     $percent_po_f{'total'}{$lang} = 0;
249     $percent_po_u{'total'}{$lang} = 0;
250     }
251 barbier 1.40 }
252 french 1.43 print "done.\n" if ($config{'verbose'});
253 barbier 1.40
254 joy 1.1 # =============== Create HTML files ===============
255 joy 1.14 mkdir ($config{'htmldir'}, 02775) if (! -d $config{'htmldir'});
256 joy 1.1
257 kraai 1.27 my @filenames = sort keys %files;
258     my $nfiles = scalar @filenames;
259 joy 1.1
260 joy 1.7 print "Creating files: " if ($config{'verbose'});
261 joy 1.14 foreach $lang (@search_in) {
262 joy 1.1 $l = $langs{$lang};
263 joy 1.7 print "$l.html " if ($config{'verbose'});
264 joy 1.8 $l = "zh-cn" if ($l eq "zh"); # kludge
265    
266     $t_body = $u_body = $o_body = "";
267 joy 1.4
268 french 1.43 # get stats about files
269 kraai 1.27 foreach $file (@filenames) {
270 barbier 1.24 next if ($file eq "");
271 joy 1.4 # Translated pages
272 joy 1.7 if (index ($wmlfiles{$lang}, " $file ") >= 0) {
273 barbier 1.24 $translated{$lang}++;
274 barbier 1.25 $orig = $original{"$lang/$file"} || "english";
275 joy 1.4 # Outdated translations
276 barbier 1.25 $msg = check_translation ($transversion{"$lang/$file"}, $version{"$orig/$file"}, "$lang/$file");
277 joy 1.4 if (length ($msg)) {
278 joy 1.12 $o_body .= "<tr>";
279 joy 1.23 if ($file eq "devel/wnpp/wnpp") {
280 joy 1.21 $o_body .= sprintf "<td>%s</td>", $file;
281     } else {
282     $o_body .= sprintf "<td><a href=\"/%s.%s.html\">%s</a></td>", $file, $l, $file;
283     }
284 barbier 1.25 $o_body .= sprintf "<td>%s</td>", $transversion{"$lang/$file"};
285 barbier 1.24 $o_body .= sprintf "<td>%s</td>", $version{"$orig/$file"};
286 joy 1.12 $o_body .= sprintf "<td>%s</td>", $msg;
287 barbier 1.41 $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"};
288 french 1.50 $o_body .= sprintf "<td align=center>%s</td>", $maintainer{"$lang/$file"}||"?";
289 joy 1.12 $o_body .= "</tr>\n";
290 joy 1.4 $outdated{$lang}++;
291 kraai 1.28 # Up-to-date translations
292     } else {
293     if ($file eq "devel/wnpp/wnpp") {
294     $t_body .= sprintf "%s<br>\n", $file;
295     } else {
296     $t_body .= sprintf "<a href=\"/%s.%s.html\">%s</a><br>\n", $file, $l, $file;
297     }
298 joy 1.4 }
299     }
300     # Untranslated pages
301     else {
302 joy 1.23 if ($file eq "devel/wnpp/wnpp") {
303 joy 1.21 $u_body .= sprintf "%s<br>\n", $file;
304     } else {
305     $u_body .= sprintf "<a href=\"/%s\">%s</a><br>\n", $file, $file;
306     }
307 joy 1.4 $untranslated{$lang}++;
308     }
309     }
310 french 1.43
311    
312 joy 1.8 # this is where we discard the files that the translation directory contains
313     # but which don't exist in the English directory
314     # print "extra files: ".$wml{$lang}-$translated{$lang}."\n";
315     $wml{$lang} = $translated{$lang};
316 joy 1.6 $translated{$lang} = $translated{$lang} - $outdated{$lang};
317    
318 alfie 1.30 $percent_a{$lang} = int ($wml{$lang}/$nfiles * 100 + .5);
319 ender 1.39 $percent_t{$lang} = int ($translated{$lang}/$wml{$lang} * 100 + .5);
320     $percent_o{$lang} = 100 - $percent_t{$lang};
321 kraai 1.28 $percent_u{$lang} = 100 - $percent_a{$lang};
322 joy 1.4
323 joy 1.1 if (open (HTML, ">$config{'htmldir'}/$l.html")) {
324 barbier 1.41 printf HTML "<html><head><title>%s: %s</title></head><body bgcolor=\"#ffffff\">\n", $config{'title'}, ucfirst $lang;
325 joy 1.1
326 joy 1.7 $color = get_color ($percent_a{$lang});
327 joy 1.1
328 barbier 1.44 print HTML "<a name=\"top\"></a>\n";
329 barbier 1.41 printf HTML "<table width=\"100%%\" cellpadding=2 cellspacing=0 bgcolor=\"%s\">\n", $color;
330 joy 1.1
331 barbier 1.41 printf HTML "<tr><td colspan=4><h1 align=\"center\">%s: %s</h1></td></tr>", $config{'title'}, ucfirst $lang;
332 joy 1.1
333 joy 1.4 print HTML "<tr>\n";
334 barbier 1.41 printf HTML "<td align=\"center\" width=\"25%%\"><b>%d files (%d%%) translated</b></td>", $wml{$lang}, $percent_a{$lang};
335     printf HTML "<td align=\"center\" width=\"25%%\"><b>%d files (%d%%) up to date</b></td>", $translated{$lang}, $percent_t{$lang};
336     printf HTML "<td align=\"center\" width=\"25%%\"><b>%d files (%d%%) outdated</b></td>", $outdated{$lang}, $percent_o{$lang};
337     printf HTML "<td align=\"center\" width=\"25%%\"><b>%d files (%d%%) not translated</b></td>", $untranslated{$lang}, $percent_u{$lang};
338 joy 1.8 print HTML "</tr>\n";
339     print HTML "</table>\n";
340 joy 1.1
341 french 1.43 # Make the table of content
342     print HTML "<h3>Table of Contents</h3>\n";
343     print HTML "<p><a href=\"./\">Back to index of languages</a></p>\n";
344 alfie 1.49 print HTML "<br /><a href=\"../\">Working on the website</a>\n";
345 french 1.43 if ($o_body) {
346 alfie 1.49 print HTML "<br /><a href=\"#outdated\">Outdated translations</a>\n";
347 french 1.43 }
348     if ($u_body) {
349 alfie 1.49 print HTML "<br /><a href=\"#untranslated\">Pages not translated</a>\n";
350 french 1.43 }
351     if ($t_body) {
352 alfie 1.49 print HTML "<br /><a href=\"#uptodate\">Translations up to date</a>\n";
353 french 1.43 }
354     if ($lang ne 'english') {
355 alfie 1.49 print HTML "<br /><a href=\"#gettext\">Translations of templates (gettext files)</a>\n";
356 french 1.43 }
357 alfie 1.49 print HTML "</p>\n";
358 french 1.43
359     # outputs the content
360 joy 1.4 if ($o_body) {
361 barbier 1.46 print HTML "<h3><a name='outdated'>Outdated translations</a>: <a href='#top'>(top)</a></h3>\n";
362 joy 1.1 print HTML "<table border=0 cellpadding=1 cellspacing=1>\n";
363 alfie 1.32 print HTML "<tr><th>File</th><th>Translated</th><th>Origin</th><th>Comment</th>";
364 joy 1.12 if ($opt_d eq "u") { print HTML "<th>Unified diff</th>"; }
365     elsif ($opt_d eq "h") { print HTML "<th>Colored diff</th>"; }
366     else { print HTML "<th>Diff</th>"; }
367 french 1.50 print HTML "<th>Maintainer</th>";
368 joy 1.12 print HTML "</tr>\n";
369 joy 1.4 print HTML $o_body;
370 joy 1.1 print HTML "</table>\n";
371     }
372 joy 1.4 if ($u_body) {
373 barbier 1.46 print HTML "<h3><a name='untranslated'>Pages not translated</a>: <a href='#top'>(top)</a></h3>\n";
374 joy 1.4 print HTML $u_body;
375 joy 1.1 }
376 joy 1.4 if ($t_body) {
377 barbier 1.46 print HTML "<h3><a name='uptodate'>Translations up to date</a>: <a href='#top'>(top)</a></h3>\n";
378 joy 1.4 print HTML $t_body;
379 joy 1.1 }
380 french 1.43 # outputs the gettext stats
381     if ($lang ne 'english') {
382 joy 1.45 print HTML "<h3><a name='gettext'>Translations of templates (gettext files)</a>: <a href='#top'>(top)</a></h3>\n";
383 french 1.43 # print HTML $border_head;
384     print HTML "<table width=\"100%\" border=0>\n";
385     print HTML "<tr><th>File</th><th>Up to date</th><th>Fuzzy</th><th>Untranslated</th><th>Total</th></tr>\n";
386     $l = $langs{$lang};
387     $l = "zh-cn" if ($l eq "zh"); # kludge
388    
389     foreach my $domain (sort keys %po_total) {
390     next if $domain eq 'total';
391     print HTML "<tr>";
392    
393     $color_t = get_color ($percent_po_t{$domain}{$lang});
394     $color_f = get_color (100 - $percent_po_f{$domain}{$lang});
395     $color_u = get_color (100 - $percent_po_u{$domain}{$lang});
396    
397     print HTML "<td>$domain.$langs{$lang}.po</td>";
398     printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_t, $po_translated{$domain}{$lang}, $percent_po_t{$domain}{$lang};
399     printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_f, $po_fuzzy{$domain}{$lang}, $percent_po_f{$domain}{$lang};
400     printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_u, $po_untranslated{$domain}{$lang}, $percent_po_u{$domain}{$lang};
401     printf HTML "<td align=right>%d</td>", $po_total{$domain};
402     print HTML "</tr>\n";
403     }
404     print HTML "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><th>Total:</th>";
405     $color_t = get_color ($percent_po_t{'total'}{$lang});
406     $color_f = get_color (100 - $percent_po_f{'total'}{$lang});
407     $color_u = get_color (100 - $percent_po_u{'total'}{$lang});
408     printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_t, $po_translated{'total'}{$lang}, $percent_po_t{'total'}{$lang};
409     printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_f, $po_fuzzy{'total'}{$lang}, $percent_po_f{'total'}{$lang};
410     printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_u, $po_untranslated{'total'}{$lang}, $percent_po_u{'total'}{$lang};
411     printf HTML "<td align=right>%d</td>", $po_total{'total'};
412     print HTML "</tr>\n";
413     }
414     print HTML "</table>\n";
415    
416     # outputs footer
417 joy 1.1 print HTML "<hr><address>Compiled at $date</address>\n";
418     print HTML "</body></html>";
419     close (HTML);
420     }
421     }
422 joy 1.7 print "\n" if ($config{'verbose'});
423 joy 1.1
424     # =============== Creating index.html ===============
425 joy 1.7 print "Creating index.html... " if ($config{'verbose'});
426 joy 1.1
427     open (HTML, ">$config{'htmldir'}/index.html")
428     || die "Can't open $config{'htmldir'}/index.html";
429    
430 barbier 1.41 printf HTML "<html>\n<head><title>%s</title></head>\n<body bgcolor=\"#ffffff\">\n", $config{'title'};
431     printf HTML "<h1 align=\"center\">%s</h1>\n", $config{'title'};
432 joy 1.1
433 joy 1.45 print HTML "<h2>Translated web pages</h2>\n";
434 french 1.51 printf HTML "<p>There is %d pages to translate.</p>\n",($wml{'english'}+$untranslated{'english'});
435 french 1.43
436 joy 1.1 print HTML $border_head;
437 barbier 1.41 print HTML "<table width=\"100%\" border=0 bgcolor=\"#cdc9c9\">\n";
438 joy 1.8 print HTML "<tr><th>Language</th><th>Translations</th><th>Up to date</th><th>Outdated</th><th>Not translated</th></tr>\n";
439 joy 1.14 foreach $lang (@search_in) {
440 joy 1.1 $l = $langs{$lang};
441 joy 1.8 $l = "zh-cn" if ($l eq "zh"); # kludge
442 joy 1.4
443 joy 1.18 $color_a = get_color ($percent_a{$lang});
444     $color_t = get_color ($percent_t{$lang});
445 peterk 1.35 $color_o = get_color (100 - $percent_o{$lang});
446     $color_u = get_color (100 - $percent_u{$lang});
447 joy 1.4
448     print HTML "<tr>";
449 joy 1.13 printf HTML "<td><a href=\"%s.html\">%s</a> (%s)</td>", $l, ucfirst $lang, $l;
450 joy 1.18 printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_a, $wml{$lang}, $percent_a{$lang};
451 kraai 1.26 printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_t, $translated{$lang}, $percent_t{$lang};
452     printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_o, $outdated{$lang}, $percent_o{$lang};
453     printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_u, $untranslated{$lang}, $percent_u{$lang};
454 joy 1.4 print HTML "</tr>\n",
455 joy 1.1 }
456 barbier 1.41 print HTML "</table>\n";
457 barbier 1.40 print HTML $border_foot;
458 joy 1.1
459 joy 1.45 print HTML "<h2>Translated templates (gettext files)</h2>\n";
460 french 1.51 printf HTML "<p>There is %d strings to translate.</p>\n",$po_total{'total'};
461 barbier 1.40 print HTML $border_head;
462 barbier 1.41 print HTML "<table width=\"100%\" border=0 bgcolor=\"#cdc9c9\">\n";
463 french 1.51 print HTML "<tr><th>Language</th><th>Up to date</th><th>Fuzzy</th><th>Not translated</th></tr>\n";
464 barbier 1.40 foreach $lang (@search_in) {
465     next if $lang eq 'english';
466     $l = $langs{$lang};
467     $l = "zh-cn" if ($l eq "zh"); # kludge
468    
469 french 1.43 print HTML "<tr>";
470     printf HTML "<td><a href=\"%s.html#gettext\">%s</a> (%s)</td>", $l, ucfirst $lang, $l;
471     $color_t = get_color ($percent_po_t{'total'}{$lang});
472     $color_f = get_color (100 - $percent_po_f{'total'}{$lang});
473     $color_u = get_color (100 - $percent_po_u{'total'}{$lang});
474     printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_t, $po_translated{'total'}{$lang}, $percent_po_t{'total'}{$lang};
475     printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_f, $po_fuzzy{'total'}{$lang}, $percent_po_f{'total'}{$lang};
476     printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_u, $po_untranslated{'total'}{$lang}, $percent_po_u{'total'}{$lang};
477     print HTML "</tr>\n";
478     }
479 barbier 1.40
480 barbier 1.41 print HTML "</table>\n";
481 joy 1.1 print HTML $border_foot;
482    
483 barbier 1.41 print HTML "<p><hr noshade size=1 width=\"100%\">\n";
484 joy 1.4 print HTML "<p>Created with <a href=\"http://cvs.debian.org/webwml/stattrans.pl?cvsroot=webwml\">webwml-stattrans</a> at $date\n";
485 joy 1.3 print HTML "</body></html>\n";
486 joy 1.1 close (HTML);
487    
488 joy 1.7 print "done.\n" if ($config{'verbose'});
489 joy 1.1
490     # Note:
491     # Translated pages on ll.html may be higher than in index.html.
492     # This is due to the fact that some english pages were removed.
493    
494     # printf "%s\n", join ("\n", keys %version);
495     # printf "%s - %s\n", $version{'german/devel/index'}, $version{'english/devel/index'};

  ViewVC Help
Powered by ViewVC 1.1.5