[DOC-CVS] [doc-base] master: Remove filename conventions for do-not-translate in revcheck (#319)

[email protected] (alfsb via GitHub) Mon, 20 Jul 2026 20:55:58 +0000
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: alfsb (alfsb)
Committer: GitHub (web-flow)
Pusher: alfsb
Date: 2026-07-20T17:55:56-03:00

Commit: https://github.com/php/doc-base/commit/9391318e46e6fdd09721a9f5e3553089e4382009
Raw diff: https://github.com/php/doc-base/commit/9391318e46e6fdd09721a9f5e3553089e4382009.diff

Remove filename conventions for do-not-translate in revcheck (#319)

Changed paths:
  M  scripts/translation/lib/RevcheckFileList.php
  M  scripts/translation/lib/RevcheckIgnore.php
  M  scripts/translation/lib/RevcheckRun.php


Diff:

diff --git a/scripts/translation/lib/RevcheckFileList.php b/scripts/translation/lib/RevcheckFileList.php
index 671581bd15..562a2e2220 100644
--- a/scripts/translation/lib/RevcheckFileList.php
+++ b/scripts/translation/lib/RevcheckFileList.php
@@ -68,7 +68,7 @@ function loadTreeRecurse( $lang , $path )
                 continue;
             }
 
-            if ( RevcheckIgnore::ignore( $key ) )
+            if ( RevcheckIgnore::byName( $key ) )
                 continue;
             $file = new RevcheckFileItem( $key , $entry->getSize() );
             $this->list[ $key ] = $file;
diff --git a/scripts/translation/lib/RevcheckIgnore.php b/scripts/translation/lib/RevcheckIgnore.php
index 27f77104d3..0d4c9f1779 100644
--- a/scripts/translation/lib/RevcheckIgnore.php
+++ b/scripts/translation/lib/RevcheckIgnore.php
@@ -13,7 +13,7 @@
  *  +----------------------------------------------------------------------+
  *  | Authors:     André L F S Bacci <ae php.net>                          |
  *  +----------------------------------------------------------------------+
- *  | Description: Files ignored on translation tree.                      |
+ *  | Description: Files ignored on manual tree.                           |
  *  +----------------------------------------------------------------------+
  */
 
@@ -21,55 +21,23 @@
 
 class RevcheckIgnore
 {
-    public static function ignore( $filename ) : bool
+    public static function byName( $filename ) : bool
     {
-        // Ignore dot files
-
         if ( $filename[0] == '.' )
             return true;
 
-        // Ignore files other than xml assets
-
         if ( ( str_ends_with( $filename , '.xml' ) || str_ends_with( $filename , '.ent' ) ) == false )
             return true;
 
-        // Ignore autogenerated files
-
-        if ( str_starts_with( $filename , "entities." ) )
-            return true;
-        if ( str_contains( $filename , "/entities." ) )
-            return true;
-        if ( str_contains( $filename , "/versions.xml" ) )
-            return true;
-
-        // Only in English, autogenerated, marked not translatable
-
-        if ( $filename == "contributors.ent" )
-            return true;
-        if ( $filename == "contributors.xml" )
-            return true;
-        if ( $filename == "appendices/license.xml" )
-            return true;
-        if ( $filename == "appendices/extensions.xml" )
-            return true;
-        if ( $filename == "appendices/reserved.constants.xml" )
-            return true;
-        if ( $filename == "reference/datetime/timezones.xml" )
-            return true;
-
-        // Only in translations
-
         if ( $filename == "translation.xml" )
             return true;
 
-        // At least, do not ignore
         return false;
     }
 
-    public static function mark( $filename )
+    public static function byMark( $filename )
     {
         $contents = file_get_contents( $filename );
-        $skip = strpos( $contents , '<?do-not-translate?>' ) !== false;
-        return $skip;
+        return str_contains( $contents , '<?do-not-translate?>' );
     }
 }
diff --git a/scripts/translation/lib/RevcheckRun.php b/scripts/translation/lib/RevcheckRun.php
index 119dfebdb7..e9f82d354e 100644
--- a/scripts/translation/lib/RevcheckRun.php
+++ b/scripts/translation/lib/RevcheckRun.php
@@ -82,7 +82,7 @@ private function calculateStatus()
 
             if ( $target == null )
             {
-                if ( RevcheckIgnore::mark( "{$this->sourceDir}/{$source->file}" ) )
+                if ( RevcheckIgnore::byMark( "{$this->sourceDir}/{$source->file}" ) )
                     continue;
 
                 $source->status = RevcheckStatus::Untranslated;