Skip to content

Commit b457f42

Browse files
authored
Remove backported revcheck compatibility (#176)
includes `chmonly` and some `reserved.xml` as tracked files for translation. Changes counting on translators table.
1 parent bee795d commit b457f42

File tree

4 files changed

+8
-70
lines changed

4 files changed

+8
-70
lines changed

scripts/revcheck.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ function print_html_header( RevcheckData $data )
9191
<body>
9292
9393
<div id="header" style="background-color: #9999CC;">
94-
<h1 style="margin: 0; padding: 0.5em;">Status of the translated PHP Manual</h1>
95-
<p style="font-size: small; margin: 0; padding: 1em;">Generated: $date / Language: $lang</p>
94+
<h1 style="margin: 0; padding: 0.5em;">Status of the PHP Manual $lang translation</h1>
95+
<p style="margin: 0; padding: 0 1em 1em 1em;">Generated: $date</p>
9696
</div>
9797
HTML;
9898
}
@@ -133,9 +133,9 @@ function print_html_translators( RevcheckData $data )
133133
<th colspan=4>Files maintained</th>
134134
</tr>
135135
<tr>
136-
<th>upto-<br/>date</th> <!-- STATUS_COUNT_MISMATCH <th>ok</th> -->
136+
<th>ok</th>
137137
<th>old</th>
138-
<th>wip</th> <!-- STATUS_COUNT_MISMATCH <th>misc</th> -->
138+
<th>misc</th>
139139
<th>sum</th>
140140
</tr>
141141
HTML;

scripts/translation/lib/RevcheckIgnore.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,6 @@ public static function ignore( $filename ) : bool
5757
if ( $filename == "reference/datetime/timezones.xml" )
5858
return true;
5959

60-
if ( IGNORE_EXTENSIONS_XML )
61-
if ( str_ends_with( $filename , '/extensions.xml') ) // track/count backport
62-
return true;
63-
if ( IGNORE_CHMONLY_DIR )
64-
if ( str_starts_with( $filename , 'chmonly/') ) // track/count backport
65-
return true;
66-
6760
// Only in translations
6861

6962
if ( $filename == "translation.xml" )

scripts/translation/lib/RevcheckRun.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -182,29 +182,17 @@ private function addData( RevcheckFileInfo $info , RevtagInfo|null $revtag = nul
182182

183183
$translator = $this->revData->getTranslator( $revtag->maintainer );
184184

185-
switch( $info->status ) // counts
185+
switch( $info->status )
186186
{
187-
case RevcheckStatus::TranslatedOk: // ready and synced
187+
case RevcheckStatus::TranslatedOk:
188188
$translator->countOk++;
189189
break;
190-
case RevcheckStatus::TranslatedOld: // ready and outdated
190+
case RevcheckStatus::TranslatedOld:
191191
$translator->countOld++;
192192
break;
193-
// STATUS_COUNT_MISMATCH count correct
194-
// default: // all other cases
195-
// $translator->countOther++;
196-
197-
// STATUS_COUNT_MISMATCH backported behaviour
198-
case RevcheckStatus::RevTagProblem: // STATUS_COUNT_MISMATCH backported behaviour
199-
$translator->countOld++; // RevTagProblem into Old (generated diff link fails)
200-
break;
201-
case RevcheckStatus::NotInEnTree: // STATUS_COUNT_MISMATCH backported behaviour
202-
break; // Not counted, but files are listed anyways...
203193
default:
204-
if ( $revtag->status != "ready" ); // STATUS_COUNT_MISMATCH backported behaviour
205-
$translator->countOther++; // The exception of all cases, and also not ready.
194+
$translator->countOther++;
206195
break;
207-
// STATUS_COUNT_MISMATCH backported behaviour
208196
}
209197

210198
switch( $info->status ) // adds,dels

scripts/translation/lib/backport.php

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,11 @@
99

1010
// Constants
1111

12-
const IGNORE_CHMONLY_DIR = true;
13-
const IGNORE_EXTENSIONS_XML = true;
14-
const STATUS_COUNT_MISMATCH = true;
1512
const LOOSE_SKIP_REVCHECK = true;
1613
const FIXED_SKIP_REVCHECK = true;
1714

1815
// Documentation
1916

20-
/* # IGNORE_CHMONLY_DIR
21-
22-
The chmonly/ dir contains files that appears to be
23-
translatable. See recent efforts to re-enabling
24-
CHM build: https://github.com/php/doc-base/pull/163
25-
*/
26-
27-
/* # IGNORE_EXTENSIONS_XML
28-
29-
The actual revcheck ignores any files called extensions.xml,
30-
but are at least two of files with this name.
31-
32-
- appendices/migration56/extensions.xml (translatable)
33-
- install/windows/legacy/extensions.xml (deleted on en/, exists untracked on translations)
34-
*/
35-
36-
/* # STATUS_COUNT_MISMATCH
37-
38-
The actual revcheck counts "outdated" files in two different ways;
39-
40-
- Only TranslatedOld:
41-
https://github.com/php/doc-base/blob/747c53bf8ec72f27ac1a83ba91bcc390eea2e46a/scripts/revcheck.php#L603
42-
- TranslatedOld + RevTagProblem:
43-
https://github.com/php/doc-base/blob/747c53bf8ec72f27ac1a83ba91bcc390eea2e46a/scripts/revcheck.php#L134
44-
45-
This causes a mismatchs between translators totals and file summary.
46-
47-
To make the mismatch smaller, the "wip" column in Translators was
48-
changed to "misc", and so any status other than "ok" and "old"
49-
was added here.
50-
51-
Also, NotInEnTree is missing on first case, and files
52-
in this situation goes uncounted.
53-
54-
Also, RevTagProblem is counted towards as Old, but files
55-
are show in revtag missing/problem list, and is
56-
impossible to generate diffs with invalid hashes... */
57-
58-
assert( STATUS_COUNT_MISMATCH || ! STATUS_COUNT_MISMATCH );
59-
6017
/* # LOOSE_SKIP_REVCHECK
6118
6219
Consider the output of: git show f80105b4fc1196bd8d5fecb98d686b580b1ff65d

0 commit comments

Comments
 (0)