20
23
open (FH, "$curl https://translations.launchpad.net/+groups/".$group."/ 2> /dev/null |") or die "Failed to open rosetta group lists";
23
25
if ($_ =~ m/.*<a href="\/(.*)" class="sprite product">(.*)<\/a>.*/){
25
print "Found project: $2\n";
26
print "Found project: $1 : $2\n";
26
27
push(@projects,$1);
34
# find link to all templates
34
# find status to all templates recommended translation template
36
40
foreach $project (@projects) {
37
41
open (FH, "$curl https://translations.launchpad.net/".$project." 2> /dev/null |") or die "Failed to open team project lists";
40
if ($_ =~ m#.*<a href="(/[^/]+/[^/]+/\+pots/[^/]+)">*#g) {
41
print "Found all templates for: $1\n";
42
push(@templates_all,$1);
51
foreach $template_all (@templates_all) {
52
open (FH, "$curl https://translations.launchpad.net/".$template_all." 2> /dev/null |") or die "Failed to open team project lists";
56
if ($_ =~ m#.* <a href="(/(.*)/.*/\+pots/.*/([^/]+)/\+translate\?show=new_suggestions)">(\d+)</a>
59
print "Found review template for project $2 lang $3: $1\n";
61
$templates_review_nr{$1} = $4;
62
push(@templates_review,$1);
65
if ($_ =~ m#.* <a href="/(.*)/.*/\+pots/.*/([^/]+)/\+translate">(.*)</a>
81
# generate HTML + RSS feeds
45
if ($_ =~ m#.* <a href="(/(.*)/.*/\+pots/.*/([^/]+)/\+translate)">(.*)</a>
47
#print "Found for $project $3 $4\n";
48
$templates_url{$project.$3}=$1;
50
$current_language = $3;
54
if (($current_language ne "") &&
55
($_ =~ m/<span class="sortkey">(.*)<\/span>/)) {
57
if ($current_value == 2) {
58
$langs_total_untranslated{$current_language} += $1;
59
#print "Found $project $current_language untranslated: $1\n";
62
if ($current_value == 3) {
63
$langs_total_review{$current_language} += $1;
64
$templates_review{$project.$current_language}=$1;
65
#print "Found $project $current_language review: $1\n";
69
#$templates_review_nr{$1} = $4;
70
#push(@templates_review,$1);
82
77
open (INDEX_PAGE, ">$root/index.html");
83
78
write_header (*INDEX_PAGE{IO});
84
79
print INDEX_PAGE "<h1>Translation status for $group</h1>";
86
<th>Total needs review</th>
97
92
#$langs{'fr'} ="|/geany/trunk/+pots/geany/fr/+translate?show=new_suggestions|/deja-dup/trunk/+pots/deja-dup/fr/+translate?show=new_suggestions|/gui-ufw/trunk/+pots/gufw/fr/+translate?show=new_suggestions";
98
foreach $lang (sort (keys(%langs))) {
99
@needs_review = split(/\|/,$langs{$lang});
100
shift(@needs_review);
101
print INDEX_PAGE "<tr>
102
<td><a href='$lang.html'>".$langs_name{$lang}."</a></td><td><a href='$lang.html'>".scalar(@needs_review)."</a></td>
93
foreach $lang (sort (keys(%langs_name))) {
94
print INDEX_PAGE "<tr>".
95
"<td><a href='$lang.html'>".$langs_name{$lang}."</a></td>".
96
"<td><a href='$lang.html'>".$langs_total_review{$lang}."</a></td>".
99
print INDEX_PAGE "</tbody></table>\n";
100
write_footer(*INDEX_PAGE{IO});
103
foreach $lang (sort (keys(%langs_name))) {
105
104
open LANG_PAGE, ">$root/$lang.html";
106
105
write_header (*LANG_PAGE{IO});
107
106
print LANG_PAGE "<h1>Translation status for group $group, language ".$langs_name{$lang}."</h1>";
108
107
print LANG_PAGE '<table class="sortable listing" id="translation-groups" width="100%">
112
111
<th>Needs review</th>
119
foreach $template (@needs_review) {
120
$template_short = $template;
121
$template_short =~ s/\+translate\?show=new_suggestions//;
122
print LANG_PAGE "<tr>
123
<td><a href='http://translations.launchpad.net/$template'>$template_short</a></td><td>".$templates_review_nr{$template}."</td>
116
foreach $project (@projects) {
117
if (defined($templates_url{$project.$lang})){
118
$url = 'http://translations.launchpad.net/'.$templates_url{$project.$lang}."?show=new_suggestions";
119
print LANG_PAGE "<tr>".
120
"<td><a href='$url'>$project</a></td>".
121
"<td>".$templates_review{$project.$lang}."</td>".
128
126
print LANG_PAGE "</tbody></table>\n";
129
127
write_footer(*LANG_PAGE{IO});
133
print INDEX_PAGE "</tbody></table>\n";
134
write_footer(*INDEX_PAGE{IO});
137
131
sub write_header {
138
132
local *FH = shift;