Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/translation/lib/RevcheckFileList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
33 changes: 4 additions & 29 deletions scripts/translation/lib/RevcheckIgnore.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
* +----------------------------------------------------------------------+
* | Authors: André L F S Bacci <ae php.net> |
* +----------------------------------------------------------------------+
* | Description: Files ignored on translation tree. |
* | Description: Files ignored on manual tree. |
* +----------------------------------------------------------------------+
*/

require_once __DIR__ . '/all.php';

class RevcheckIgnore
{
public static function ignore( $filename ) : bool
public static function byName( $filename ) : bool
{
// Ignore dot files

Expand All @@ -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" )

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this file? Why is it ignored here?

Expand All @@ -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 , '<?do-not-translate?>' ) !== false;
return $skip;
return str_contains( $contents , '<?do-not-translate?>' );
}
}
2 changes: 1 addition & 1 deletion scripts/translation/lib/RevcheckRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down