|
13 | 13 | * +----------------------------------------------------------------------+ |
14 | 14 | * | Authors: André L F S Bacci <ae php.net> | |
15 | 15 | * +----------------------------------------------------------------------+ |
16 | | - * | Description: Files ignored on translation tree. | |
| 16 | + * | Description: Files ignored on manual tree. | |
17 | 17 | * +----------------------------------------------------------------------+ |
18 | 18 | */ |
19 | 19 |
|
20 | 20 | require_once __DIR__ . '/all.php'; |
21 | 21 |
|
22 | 22 | class RevcheckIgnore |
23 | 23 | { |
24 | | - public static function ignore( $filename ) : bool |
| 24 | + public static function byName( $filename ) : bool |
25 | 25 | { |
26 | | - // Ignore dot files |
27 | | - |
28 | 26 | if ( $filename[0] == '.' ) |
29 | 27 | return true; |
30 | 28 |
|
31 | | - // Ignore files other than xml assets |
32 | | - |
33 | 29 | if ( ( str_ends_with( $filename , '.xml' ) || str_ends_with( $filename , '.ent' ) ) == false ) |
34 | 30 | return true; |
35 | 31 |
|
36 | | - // Ignore autogenerated files |
37 | | - |
38 | | - if ( str_starts_with( $filename , "entities." ) ) |
39 | | - return true; |
40 | | - if ( str_contains( $filename , "/entities." ) ) |
41 | | - return true; |
42 | | - if ( str_contains( $filename , "/versions.xml" ) ) |
43 | | - return true; |
44 | | - |
45 | | - // Only in English, autogenerated, marked not translatable |
46 | | - |
47 | | - if ( $filename == "contributors.ent" ) |
48 | | - return true; |
49 | | - if ( $filename == "contributors.xml" ) |
50 | | - return true; |
51 | | - if ( $filename == "appendices/license.xml" ) |
52 | | - return true; |
53 | | - if ( $filename == "appendices/extensions.xml" ) |
54 | | - return true; |
55 | | - if ( $filename == "appendices/reserved.constants.xml" ) |
56 | | - return true; |
57 | | - if ( $filename == "reference/datetime/timezones.xml" ) |
58 | | - return true; |
59 | | - |
60 | | - // Only in translations |
61 | | - |
62 | 32 | if ( $filename == "translation.xml" ) |
63 | 33 | return true; |
64 | 34 |
|
65 | | - // At least, do not ignore |
66 | 35 | return false; |
67 | 36 | } |
68 | 37 |
|
69 | | - public static function mark( $filename ) |
| 38 | + public static function byMark( $filename ) |
70 | 39 | { |
71 | 40 | $contents = file_get_contents( $filename ); |
72 | | - $skip = strpos( $contents , '<?do-not-translate?>' ) !== false; |
73 | | - return $skip; |
| 41 | + return str_contains( $contents , '<?do-not-translate?>' ); |
74 | 42 | } |
75 | 43 | } |
0 commit comments