From 9d66906bba022a14ca326f8e31abd449492f212f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20L=20F=20S=20Bacci?= Date: Thu, 9 Jul 2026 16:47:50 -0300 Subject: [PATCH] Remove filename conventions for do-not-translate in revcheck --- scripts/translation/lib/RevcheckFileList.php | 2 +- scripts/translation/lib/RevcheckIgnore.php | 33 +++----------------- scripts/translation/lib/RevcheckRun.php | 2 +- 3 files changed, 6 insertions(+), 31 deletions(-) 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..efd1fdd37f 100644 --- a/scripts/translation/lib/RevcheckIgnore.php +++ b/scripts/translation/lib/RevcheckIgnore.php @@ -13,7 +13,7 @@ * +----------------------------------------------------------------------+ * | Authors: André L F S Bacci | * +----------------------------------------------------------------------+ - * | Description: Files ignored on translation tree. | + * | Description: Files ignored on manual tree. | * +----------------------------------------------------------------------+ */ @@ -21,7 +21,7 @@ class RevcheckIgnore { - public static function ignore( $filename ) : bool + public static function byName( $filename ) : bool { // Ignore dot files @@ -33,30 +33,6 @@ public static function ignore( $filename ) : bool 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" ) @@ -66,10 +42,9 @@ public static function ignore( $filename ) : bool return false; } - public static function mark( $filename ) + public static function byMark( $filename ) { $contents = file_get_contents( $filename ); - $skip = strpos( $contents , '' ) !== false; - return $skip; + return str_contains( $contents , '' ); } } 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;