• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision4987 (tree)
Zeit2005-11-21 22:33:58
Autorluebbe.tortoisesvn

Log Message

Property change
svn:eol-style=native

Ändern Zusammenfassung

Diff

--- trunk/contrib/po-stats/translation_status.php (revision 4986)
+++ trunk/contrib/po-stats/translation_status.php (revision 4987)
@@ -1,234 +1,234 @@
1-<!--break-->
2-<?php
3-// index.php
4-//
5-// Main page. Lists all the translations
6-
7-//include("trans_data.inc");
8-//include("trans_countries.inc");
9-include("/home/groups/t/to/tortoisesvn/htdocs/includes/trans_data.inc");
10-include("/home/groups/t/to/tortoisesvn/htdocs/includes/trans_countries.inc");
11-
12-$vars['release']="1.2.6";
13-$vars['reposurl']="http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk/Languages/";
14-//$vars['downloadurl1']="http://download.berlios.de/tortoisesvn/";
15-$vars['downloadurl1']="http://prdownloads.sourceforge.net/tortoisesvn/";
16-$vars['downloadurl2']="?download";
17-$basename="Tortoise";
18-$template=$basename.".pot";
19-$vars['flagpath']="/flags/world.small/";
20-
21-function print_header($vars)
22-{
23-?>
24-
25-<div class="content">
26-<h2>Translations (in Revision <?php echo $vars['wcrev']; ?>)</h2>
27-
28-<p>
29-This page is informing you about the translation status of the current development version of TortoiseSVN, which is always ahead of the latest official release. The statistics are calculated for the HEAD revision and updated nightly. The last update was run at <b><?php echo $vars['update']; ?></b>.
30-</p>
31-
32-<p>
33-The language pack installers can be downloaded from this page as well. The installers are always built for the last official release <b>(<?php echo $vars['release'] ?>)</b>.
34-</p>
35-
36-<p>
37-If you want to download the po file from the repository, either use <strong>guest/guest</strong> or your tigris.org user ID.
38-</p>
39-
40-<?php
41-}
42-
43-function print_footer($vars)
44-{
45-$dlfile = $vars['downloadurl1']."Language_".$vars['release'].".zip".$vars['downloadurl2'];
46-
47-?>
48-<p>
49-<img src="files/translated.png" alt="translated" title="translated" width="32" height="16"/> Translated <img src="files/missingaccelerator.png" alt="missing accelerator keys" title="missing accelerator keys" width="32" height="16"/> Missing accelerator keys <img src="files/fuzzy.png" alt="fuzzy" title="fuzzy" width="32" height="16"/> Fuzzy <img src="files/untranslated.png" alt="untranslated" title="untranslated" width="32" height="16" /> Untranslated
50-</p>
51-<p>
52-Translations were made by many people, you find them on the list of <a href="http://tortoisesvn.tigris.org/contributors.html">contributors</a>.
53-</p>
54-
55-</div>
56-
57-<?php
58-}
59-
60-function print_table_header($name, $summary, $vars)
61-{
62-?>
63-<h2><?php echo $summary ?></h2>
64-<div class="table">
65-<table class="translations" summary="<?php echo $summary ?>">
66-<tr>
67-<th class="lang">Nr.</th>
68-<th class="lang">Download Installer (<?php echo $vars['release'] ?>)</th>
69-<th class="lang">ISO code</th>
70-<th colspan="2" class="trans">(<?php echo $vars['total'] ?>) Complete</th>
71-<th class="graph">Graph</th>
72-<th class="download">Download .po file</th>
73-<th class="download">Last update</th>
74-</tr>
75-<?php
76-}
77-
78-function print_table_footer()
79-{
80-?>
81-</table>
82-</div>
83-<div style="clear:both">&nbsp;<br/></div>
84-<?php
85-}
86-
87-function print_blank_stat($i, $postat, $poinfo, $vars)
88-{
89- $reposurl = $vars['reposurl'];
90- $tl = $vars['total'];
91-
92- if ($poinfo[0] == '') {
93- $flagimg=$vars['flagpath']."gb.png";
94- } else {
95- $flagimg=$vars['flagpath']."$poinfo[0].png";
96- }
97-
98- echo "<td>$i</td>";
99- echo "<td class=\"lang\"><img src=\"$flagimg\" height=\"12\" width=\"18\" />&nbsp;<a href=\"$dlfile\">$poinfo[1]</a></td>";
100- echo "<td class=\"lang\">&nbsp;</td>";
101- echo "<td class=\"trans\">$tl</td>";
102- echo "<td class=\"trans\">0.0%</td>";
103- echo "<td class=\"graph\">&nbsp;</td>";
104- echo "<td class=\"download\"><a href=\"$reposurl$postat[5]\">$postat[5]</a></td>";
105- echo "<td class=\"download\">&nbsp;</td>";
106-}
107-
108-function print_content_stat($i, $postat, $poinfo, $vars)
109-{
110- $wc=150;
111- $wp=$wc/100;
112-
113- $total=$vars['total'];
114- $release=$vars['release'];
115- $reposurl=$vars['reposurl'];
116- $reposfile=$postat[5].'.po';
117- $dlfile=$vars['downloadurl1']."LanguagePack_".$release."_".$poinfo[0].".exe".$vars['downloadurl2'];
118- $fdate=date("Y-m-d",$postat[6]);
119-
120- $acc=$postat[4];
121- $unt=$postat[3];
122- $fuz=$postat[2];
123- $tra=$postat[1];
124-
125- // Calculate width of bars
126- $wa=round($wc*$acc/$total);
127- $wf=round($wc*$fuz/$total);
128- $wu=round($wc*$unt/$total);
129-
130- // Calculate width and percentage done. Do this before adjustments!
131- $wt = $wc-$wa-$wf-$wu;
132- $pt=number_format($wt/$wp, 1)."%";
133-
134- // Adjustments
135- // make sure that each bar is at least 1px wide if it's value is > 0
136- if (($wa<2) && ($acc>0)) $wa=2;
137- if (($wf<2) && ($fuz>0)) $wf=2;
138- if (($wu<2) && ($unt>0)) $wu=2;
139-
140- // Adjust total width accordingly
141- $wt = $wc-$wa-$wf-$wu;
142-
143- // if completeness was rounded up to 100% and
144- // anything is missing, set completeness down to 99.9%
145- if ( ($pt=="100.0%") && ($wa+$wf+$wu>0) )
146- $pt="99.9%";
147-
148- if ($pt=="100.0%") {
149- $title="Perfect :-)";
150- } else {
151- $title="tr:$tra&nbsp;fu:$fuz&nbsp;ut:$unt;&nbsp;$acc&nbsp;missing&nbsp;hotkeys";
152- }
153- $flagimg=$vars['flagpath']."$poinfo[0].png";
154-
155- // count fuzzies as translated, only for the display
156- $tra=$tra+$fuz;
157-
158- echo "<td>$i</td>";
159- echo "<td class=\"lang\"><img src=\"$flagimg\" height=\"12\" width=\"18\" />&nbsp;<a href=\"$dlfile\">$poinfo[1]</a></td>";
160- echo "<td class=\"lang\">$poinfo[0]</td>";
161- echo "<td class=\"trans\">$tra</td>";
162- echo "<td class=\"trans\">$pt</td>";
163- echo "<td class=\"graph\">";
164- echo "<img src=\"files/translated.png\" alt=\"tr\" title=\"$title\" width=\"$wt\" height=\"16\"/>";
165- echo "<img src=\"files/missingaccelerator.png\" alt=\"mh\" title=\"$title\" width=\"$wa\" height=\"16\"/>";
166- echo "<img src=\"files/fuzzy.png\" alt=\"fu\" title=\"$title\" width=\"$wf\" height=\"16\"/>";
167- echo "<img src=\"files/untranslated.png\" alt=\"un\" title=\"$title\" width=\"$wu\" height=\"16\" />";
168- echo "</td>";
169- echo "<td class=\"download\"><a href=\"$reposurl$reposfile\">$reposfile</a></td>";
170- echo "<td class=\"lang\">$fdate</td>";
171-}
172-
173-function print_single_stat($i, $postat, $poinfo, $vars)
174-{
175- if (($postat[0] > 0) || ($postat[1] == $postat[3])){
176- echo "<tr class=\"error\">\n";
177- print_blank_stat($i, $postat, $poinfo, $vars);
178- }
179- else if ($postat[1] == 0) {
180- echo "<tr class=\"ok\">\n";
181- print_blank_stat($i, $postat, $poinfo, $vars);
182- }
183- else {
184- echo "<tr class=\"ok\">\n";
185- print_content_stat($i, $postat, $poinfo, $vars);
186- }
187- echo "</tr>\n";
188-}
189-
190-function print_all_stats($data, $country, $vars)
191-{
192- $i=0;
193- foreach ($data as $key => $postat)
194- {
195- $i++;
196- print_single_stat($i, $postat, $country[$key], $vars);
197- }
198-}
199-
200-//------------------------------------
201-//
202-// The program starts here
203-//
204-
205-print_header($vars);
206-
207-// Print Alphabetical statistics
208-print_table_header('alpha', 'Languages ordered by ISO Code', $vars);
209-print_all_stats($data, $country, $vars);
210-print_table_footer();
211-
212-// Convert Data into a list of columns
213-foreach ($data as $key => $row) {
214- $errors[$key] = $row[0];
215- $transl[$key] = $row[1];
216- $fuzzy[$key] = $row[2];
217- $untrans[$key] = $row[3];
218- $accel[$key] = $row[4];
219- $name[$key] = $row[5];
220- $fdate[$key] = $row[6];
221-}
222-
223-// Sort the data with volume descending, edition ascending
224-// Add $data as the last parameter, to sort by the common key
225-array_multisort($untrans, SORT_ASC, $transl, SORT_DESC, $fuzzy, SORT_ASC, $accel, SORT_ASC, $name, SORT_ASC, $data);
226-
227-
228-print_table_header('toplist', 'Languages by translation status', $vars);
229-print_all_stats($data, $country, $vars);
230-print_table_footer();
231-
232-
233-print_footer($vars);
234-?>
1+<!--break-->
2+<?php
3+// index.php
4+//
5+// Main page. Lists all the translations
6+
7+//include("trans_data.inc");
8+//include("trans_countries.inc");
9+include("/home/groups/t/to/tortoisesvn/htdocs/includes/trans_data.inc");
10+include("/home/groups/t/to/tortoisesvn/htdocs/includes/trans_countries.inc");
11+
12+$vars['release']="1.2.6";
13+$vars['reposurl']="http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk/Languages/";
14+//$vars['downloadurl1']="http://download.berlios.de/tortoisesvn/";
15+$vars['downloadurl1']="http://prdownloads.sourceforge.net/tortoisesvn/";
16+$vars['downloadurl2']="?download";
17+$basename="Tortoise";
18+$template=$basename.".pot";
19+$vars['flagpath']="/flags/world.small/";
20+
21+function print_header($vars)
22+{
23+?>
24+
25+<div class="content">
26+<h2>Translations (in Revision <?php echo $vars['wcrev']; ?>)</h2>
27+
28+<p>
29+This page is informing you about the translation status of the current development version of TortoiseSVN, which is always ahead of the latest official release. The statistics are calculated for the HEAD revision and updated nightly. The last update was run at <b><?php echo $vars['update']; ?></b>.
30+</p>
31+
32+<p>
33+The language pack installers can be downloaded from this page as well. The installers are always built for the last official release <b>(<?php echo $vars['release'] ?>)</b>.
34+</p>
35+
36+<p>
37+If you want to download the po file from the repository, either use <strong>guest/guest</strong> or your tigris.org user ID.
38+</p>
39+
40+<?php
41+}
42+
43+function print_footer($vars)
44+{
45+$dlfile = $vars['downloadurl1']."Language_".$vars['release'].".zip".$vars['downloadurl2'];
46+
47+?>
48+<p>
49+<img src="files/translated.png" alt="translated" title="translated" width="32" height="16"/> Translated <img src="files/missingaccelerator.png" alt="missing accelerator keys" title="missing accelerator keys" width="32" height="16"/> Missing accelerator keys <img src="files/fuzzy.png" alt="fuzzy" title="fuzzy" width="32" height="16"/> Fuzzy <img src="files/untranslated.png" alt="untranslated" title="untranslated" width="32" height="16" /> Untranslated
50+</p>
51+<p>
52+Translations were made by many people, you find them on the list of <a href="http://tortoisesvn.tigris.org/contributors.html">contributors</a>.
53+</p>
54+
55+</div>
56+
57+<?php
58+}
59+
60+function print_table_header($name, $summary, $vars)
61+{
62+?>
63+<h2><?php echo $summary ?></h2>
64+<div class="table">
65+<table class="translations" summary="<?php echo $summary ?>">
66+<tr>
67+<th class="lang">Nr.</th>
68+<th class="lang">Download Installer (<?php echo $vars['release'] ?>)</th>
69+<th class="lang">ISO code</th>
70+<th colspan="2" class="trans">(<?php echo $vars['total'] ?>) Complete</th>
71+<th class="graph">Graph</th>
72+<th class="download">Download .po file</th>
73+<th class="download">Last update</th>
74+</tr>
75+<?php
76+}
77+
78+function print_table_footer()
79+{
80+?>
81+</table>
82+</div>
83+<div style="clear:both">&nbsp;<br/></div>
84+<?php
85+}
86+
87+function print_blank_stat($i, $postat, $poinfo, $vars)
88+{
89+ $reposurl = $vars['reposurl'];
90+ $tl = $vars['total'];
91+
92+ if ($poinfo[0] == '') {
93+ $flagimg=$vars['flagpath']."gb.png";
94+ } else {
95+ $flagimg=$vars['flagpath']."$poinfo[0].png";
96+ }
97+
98+ echo "<td>$i</td>";
99+ echo "<td class=\"lang\"><img src=\"$flagimg\" height=\"12\" width=\"18\" />&nbsp;<a href=\"$dlfile\">$poinfo[1]</a></td>";
100+ echo "<td class=\"lang\">&nbsp;</td>";
101+ echo "<td class=\"trans\">$tl</td>";
102+ echo "<td class=\"trans\">0.0%</td>";
103+ echo "<td class=\"graph\">&nbsp;</td>";
104+ echo "<td class=\"download\"><a href=\"$reposurl$postat[5]\">$postat[5]</a></td>";
105+ echo "<td class=\"download\">&nbsp;</td>";
106+}
107+
108+function print_content_stat($i, $postat, $poinfo, $vars)
109+{
110+ $wc=150;
111+ $wp=$wc/100;
112+
113+ $total=$vars['total'];
114+ $release=$vars['release'];
115+ $reposurl=$vars['reposurl'];
116+ $reposfile=$postat[5].'.po';
117+ $dlfile=$vars['downloadurl1']."LanguagePack_".$release."_".$poinfo[0].".exe".$vars['downloadurl2'];
118+ $fdate=date("Y-m-d",$postat[6]);
119+
120+ $acc=$postat[4];
121+ $unt=$postat[3];
122+ $fuz=$postat[2];
123+ $tra=$postat[1];
124+
125+ // Calculate width of bars
126+ $wa=round($wc*$acc/$total);
127+ $wf=round($wc*$fuz/$total);
128+ $wu=round($wc*$unt/$total);
129+
130+ // Calculate width and percentage done. Do this before adjustments!
131+ $wt = $wc-$wa-$wf-$wu;
132+ $pt=number_format($wt/$wp, 1)."%";
133+
134+ // Adjustments
135+ // make sure that each bar is at least 1px wide if it's value is > 0
136+ if (($wa<2) && ($acc>0)) $wa=2;
137+ if (($wf<2) && ($fuz>0)) $wf=2;
138+ if (($wu<2) && ($unt>0)) $wu=2;
139+
140+ // Adjust total width accordingly
141+ $wt = $wc-$wa-$wf-$wu;
142+
143+ // if completeness was rounded up to 100% and
144+ // anything is missing, set completeness down to 99.9%
145+ if ( ($pt=="100.0%") && ($wa+$wf+$wu>0) )
146+ $pt="99.9%";
147+
148+ if ($pt=="100.0%") {
149+ $title="Perfect :-)";
150+ } else {
151+ $title="tr:$tra&nbsp;fu:$fuz&nbsp;ut:$unt;&nbsp;$acc&nbsp;missing&nbsp;hotkeys";
152+ }
153+ $flagimg=$vars['flagpath']."$poinfo[0].png";
154+
155+ // count fuzzies as translated, only for the display
156+ $tra=$tra+$fuz;
157+
158+ echo "<td>$i</td>";
159+ echo "<td class=\"lang\"><img src=\"$flagimg\" height=\"12\" width=\"18\" />&nbsp;<a href=\"$dlfile\">$poinfo[1]</a></td>";
160+ echo "<td class=\"lang\">$poinfo[0]</td>";
161+ echo "<td class=\"trans\">$tra</td>";
162+ echo "<td class=\"trans\">$pt</td>";
163+ echo "<td class=\"graph\">";
164+ echo "<img src=\"files/translated.png\" alt=\"tr\" title=\"$title\" width=\"$wt\" height=\"16\"/>";
165+ echo "<img src=\"files/missingaccelerator.png\" alt=\"mh\" title=\"$title\" width=\"$wa\" height=\"16\"/>";
166+ echo "<img src=\"files/fuzzy.png\" alt=\"fu\" title=\"$title\" width=\"$wf\" height=\"16\"/>";
167+ echo "<img src=\"files/untranslated.png\" alt=\"un\" title=\"$title\" width=\"$wu\" height=\"16\" />";
168+ echo "</td>";
169+ echo "<td class=\"download\"><a href=\"$reposurl$reposfile\">$reposfile</a></td>";
170+ echo "<td class=\"lang\">$fdate</td>";
171+}
172+
173+function print_single_stat($i, $postat, $poinfo, $vars)
174+{
175+ if (($postat[0] > 0) || ($postat[1] == $postat[3])){
176+ echo "<tr class=\"error\">\n";
177+ print_blank_stat($i, $postat, $poinfo, $vars);
178+ }
179+ else if ($postat[1] == 0) {
180+ echo "<tr class=\"ok\">\n";
181+ print_blank_stat($i, $postat, $poinfo, $vars);
182+ }
183+ else {
184+ echo "<tr class=\"ok\">\n";
185+ print_content_stat($i, $postat, $poinfo, $vars);
186+ }
187+ echo "</tr>\n";
188+}
189+
190+function print_all_stats($data, $country, $vars)
191+{
192+ $i=0;
193+ foreach ($data as $key => $postat)
194+ {
195+ $i++;
196+ print_single_stat($i, $postat, $country[$key], $vars);
197+ }
198+}
199+
200+//------------------------------------
201+//
202+// The program starts here
203+//
204+
205+print_header($vars);
206+
207+// Print Alphabetical statistics
208+print_table_header('alpha', 'Languages ordered by ISO Code', $vars);
209+print_all_stats($data, $country, $vars);
210+print_table_footer();
211+
212+// Convert Data into a list of columns
213+foreach ($data as $key => $row) {
214+ $errors[$key] = $row[0];
215+ $transl[$key] = $row[1];
216+ $fuzzy[$key] = $row[2];
217+ $untrans[$key] = $row[3];
218+ $accel[$key] = $row[4];
219+ $name[$key] = $row[5];
220+ $fdate[$key] = $row[6];
221+}
222+
223+// Sort the data with volume descending, edition ascending
224+// Add $data as the last parameter, to sort by the common key
225+array_multisort($untrans, SORT_ASC, $transl, SORT_DESC, $fuzzy, SORT_ASC, $accel, SORT_ASC, $name, SORT_ASC, $data);
226+
227+
228+print_table_header('toplist', 'Languages by translation status', $vars);
229+print_all_stats($data, $country, $vars);
230+print_table_footer();
231+
232+
233+print_footer($vars);
234+?>
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Show on old repository browser