Peter Palfrader commited on 2005-10-05 04:05:59
Zeige 6 geänderte Dateien mit 110 Einfügungen und 27 Löschungen.
... | ... |
@@ -13,11 +13,11 @@ WMLFILES=$(wildcard en/*.wml \ |
13 | 13 |
de/*.wml \ |
14 | 14 |
it/*.wml \ |
15 | 15 |
) |
16 |
-#WMIFILES=$(wildcard include/*.wmi \ |
|
17 |
-# en/*.wmi \ |
|
18 |
-# de/*.wmi \ |
|
19 |
-# it/*.wmi \ |
|
20 |
-# ) |
|
16 |
+WMIFILES=$(wildcard include/*.wmi \ |
|
17 |
+ en/*.wmi \ |
|
18 |
+ de/*.wmi \ |
|
19 |
+ it/*.wmi \ |
|
20 |
+ ) |
|
21 | 21 |
HTMLFILES = $(patsubst de/%.wml, %.de.html, \ |
22 | 22 |
$(patsubst en/%.wml, %.en.html, \ |
23 | 23 |
$(patsubst it/%.wml, %.it.html, \ |
... | ... |
@@ -71,6 +71,7 @@ all: $(HTMLFILES) |
71 | 71 |
tor-manual-cvs.en.html: $(TORCVSHEAD)/doc/tor.1.in |
72 | 72 |
tor-manual.en.html: $(TORCVSSTABLE)/doc/tor.1.in |
73 | 73 |
|
74 |
+translation-status.en.html: $(LANGS) $(WMIFILES) $(WMLFILES) |
|
74 | 75 |
|
75 | 76 |
dep: $(DEPFILES) |
76 | 77 |
|
... | ... |
@@ -0,0 +1,76 @@ |
1 |
+## translation metadata |
|
2 |
+# Revision: $Revision$ |
|
3 |
+ |
|
4 |
+#include "head.wmi" TITLE="Translation status" |
|
5 |
+ |
|
6 |
+<div class="main-column"> |
|
7 |
+ |
|
8 |
+<h2>Tor: Translation status</h2> |
|
9 |
+<hr /> |
|
10 |
+ |
|
11 |
+<: |
|
12 |
+ my %files; |
|
13 |
+ for my $lang (@LANGUAGES) { |
|
14 |
+ opendir(DIR, $lang) or die ("Cannot opendir $lang: $!\n"); |
|
15 |
+ my @files = grep { $_ ne '.' && $_ ne '..' && $_ =~ m/^[^.]/ && -f $lang.'/'.$_} readdir(DIR); |
|
16 |
+ closedir DIR; |
|
17 |
+ |
|
18 |
+ for my $file (@files) { |
|
19 |
+ if ($lang eq 'en') { |
|
20 |
+ $files{$lang}->{$file} = translation_get_masterrevision_file($file); |
|
21 |
+ } else { |
|
22 |
+ $files{$lang}->{$file} = translation_get_basedonrevision_langfile($lang, $file); |
|
23 |
+ }; |
|
24 |
+ }; |
|
25 |
+ }; |
|
26 |
+ |
|
27 |
+ print "<table border=1>\n"; |
|
28 |
+ print "<tr>\n"; |
|
29 |
+ print "<th>File</th>\n"; |
|
30 |
+ printf("<th>%s</th>\n", $LANGUAGES{$_}) for (@LANGUAGES); |
|
31 |
+ print "</tr>\n"; |
|
32 |
+ for my $file (sort {$a cmp $b} keys %{$files{'en'}}) { |
|
33 |
+ print "<tr>"; |
|
34 |
+ printf "<th>%s</th>", $file; |
|
35 |
+ printf "<td>%s</td>", $files{'en'}->{$file}; |
|
36 |
+ for my $lang (@LANGUAGES) { |
|
37 |
+ next if $lang eq 'en'; |
|
38 |
+ if (exists $files{$lang}->{$file}) { |
|
39 |
+ if ($files{$lang}->{$file} eq $files{'en'}->{$file}) { |
|
40 |
+ printf '<td bgcolor="green">current</td>'; |
|
41 |
+ } else { |
|
42 |
+ printf '<td bgcolor="yellow">%s</td>', $files{$lang}->{$file}; |
|
43 |
+ }; |
|
44 |
+ delete $files{$lang}->{$file}; |
|
45 |
+ } else { |
|
46 |
+ printf '<td bgcolor="red">missing</td>' |
|
47 |
+ }; |
|
48 |
+ }; |
|
49 |
+ print "</tr>"; |
|
50 |
+ }; |
|
51 |
+ print "</table>\n"; |
|
52 |
+ |
|
53 |
+ for my $lang (@LANGUAGES) { |
|
54 |
+ next if $lang eq 'en'; |
|
55 |
+ if (keys %{$files{$lang}} > 0) { |
|
56 |
+ printf "<h2>Additional files in %s</h2>\n", $LANGUAGES{$lang}; |
|
57 |
+ |
|
58 |
+ print "<table border=1>\n"; |
|
59 |
+ print "<tr>\n"; |
|
60 |
+ print "<th>File</th>\n"; |
|
61 |
+ print "<th>Based on Revision</th>\n"; |
|
62 |
+ print "</tr>\n"; |
|
63 |
+ for my $file (sort {$a cmp $b} keys %{$files{$lang}}) { |
|
64 |
+ print "<tr>"; |
|
65 |
+ printf "<th>%s</th>", $file; |
|
66 |
+ printf "<td>%s</td>", $files{$lang}->{$file}; |
|
67 |
+ delete $files{$lang}->{$file}; |
|
68 |
+ }; |
|
69 |
+ print "</table>\n"; |
|
70 |
+ }; |
|
71 |
+ }; |
|
72 |
+:> |
|
73 |
+ |
|
74 |
+</div><!-- #main --> |
|
75 |
+ |
|
76 |
+#include <foot.wmi> |
... | ... |
@@ -27,29 +27,35 @@ sub getMetadata($) { |
27 | 27 |
return %data; |
28 | 28 |
}; |
29 | 29 |
|
30 |
-sub translation_get_masterrevision() { |
|
31 |
- my $page = $WML_SRC_FILENAME; |
|
32 |
- %master = getMetadata("en/$WML_SRC_FILENAME"); |
|
30 |
+sub translation_get_masterrevision_file($) { |
|
31 |
+ my ($page) = @_; |
|
32 |
+ %master = getMetadata("en/$page"); |
|
33 | 33 |
|
34 |
- die ("Cannot find 'Revision' header in master's translation metadata of en/$WML_SRC_FILENAME") unless exists $master{'Revision'}; |
|
34 |
+ die ("Cannot find 'Revision' header in master's translation metadata of en/$page") unless exists $master{'Revision'}; |
|
35 | 35 |
|
36 | 36 |
my ($rev) = $master{'Revision'} =~ m/([0-9.]+)/; |
37 | 37 |
if ($rev eq '') { $rev = '(Revision not a valid number)'; }; |
38 | 38 |
|
39 | 39 |
return $rev; |
40 | 40 |
}; |
41 |
+sub translation_get_masterrevision() { |
|
42 |
+ translation_get_masterrevision_file($WML_SRC_FILENAME); |
|
43 |
+}; |
|
41 | 44 |
|
42 |
-sub translation_get_basedonrevision() { |
|
43 |
- my $page = $WML_SRC_FILENAME; |
|
44 |
- %translation = getMetadata("$(LANG)/$WML_SRC_FILENAME"); |
|
45 |
+sub translation_get_basedonrevision_langfile($$) { |
|
46 |
+ my ($lang, $page) = @_; |
|
47 |
+ %translation = getMetadata("$lang/$page"); |
|
45 | 48 |
|
46 |
- die ("Cannot find 'Based-On-Revision' header in translations's translation metadata of $(LANG)/$WML_SRC_FILENAME") unless exists $translation{'Based-On-Revision'}; |
|
49 |
+ die ("Cannot find 'Based-On-Revision' header in translations's translation metadata of $lang/$page") unless exists $translation{'Based-On-Revision'}; |
|
47 | 50 |
|
48 | 51 |
my ($rev) = $translation{'Based-On-Revision'}; |
49 | 52 |
if ($rev eq '') { $rev = '(unknown)'; }; |
50 | 53 |
|
51 | 54 |
return $rev |
52 | 55 |
}; |
56 |
+sub translation_get_basedonrevision() { |
|
57 |
+ translation_get_basedonrevision_langfile($(LANG), $WML_SRC_FILENAME); |
|
58 |
+}; |
|
53 | 59 |
|
54 | 60 |
|
55 | 61 |
sub translation_current() { |
... | ... |
@@ -1,4 +1,5 @@ |
1 | 1 |
#! /usr/bin/wml |
2 |
+#include "perl-globals.wmi" |
|
2 | 3 |
#include "links.wmi" |
3 | 4 |
#include "versions.wmi" |
4 | 5 |
#include "navigation.wmi" |
... | ... |
@@ -16,14 +17,6 @@ |
16 | 17 |
|
17 | 18 |
<body> |
18 | 19 |
|
19 |
-<: |
|
20 |
- %languages = ( |
|
21 |
- 'en' => "English", |
|
22 |
- 'de' => "Deutsch", |
|
23 |
- 'it' => "Italiano" |
|
24 |
- ); |
|
25 |
-:> |
|
26 |
- |
|
27 | 20 |
<div class="center"> |
28 | 21 |
<table class="banner" border="0" cellpadding="0" cellspacing="0"> |
29 | 22 |
<tr> |
... | ... |
@@ -50,14 +43,10 @@ |
50 | 43 |
</td> |
51 | 44 |
<td class="banner-right"> |
52 | 45 |
<: |
53 |
- opendir(DIR, ".") || die ("Cannot open directory .: $!\n"); |
|
54 |
- my @subdirs = grep { $_ ne '.' && $_ ne '..' && -d $_ && $_ ne "$(LANG)" && exists $languages{$_}} readdir(DIR); |
|
55 |
- closedir(DIR); |
|
56 |
- |
|
57 | 46 |
$page = $WML_SRC_FILENAME; |
58 | 47 |
$page =~ s/\.wml//; |
59 |
- for my $dir (sort {$languages{$a} cmp $languages{$b}} @subdirs) { |
|
60 |
- printf('<a href="%s.%s.html"><img src="$(IMGROOT)/%s.png" alt="%s" /></a>', $page, $dir, $dir, $languages{$dir}) if (-e "$dir/$WML_SRC_FILENAME"); |
|
48 |
+ for my $dir (sort {$LANGUAGES{$a} cmp $LANGUAGES{$b}} @LANGUAGES) { |
|
49 |
+ printf('<a href="%s.%s.html"><img src="$(IMGROOT)/%s.png" alt="%s" /></a>', $page, $dir, $dir, $LANGUAGES{$dir}) if (-e "$dir/$WML_SRC_FILENAME"); |
|
61 | 50 |
}; |
62 | 51 |
:> |
63 | 52 |
</td> |