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 | * +----------------------------------------------------------------------+ - * | 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 , '' ) !== 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;