Current status
We've removed all occurrences of black/white list from the Translate code base. We also updated the configuration in dependent projects to reflect the change.
Original report
Targets Occurrences of '(white|black)[ \-]?list' in Directory /Users/reedy/PhpstormProjects/mediawiki/extensions/Translate Found Occurrences (120 usages found) extensions (120 usages found) Translate (120 usages found) api (3 usages found) ApiQueryMessageCollection.php (3 usages found) 44 global $wgTranslateBlacklist; 73 if ( isset( $wgTranslateBlacklist[ $check ][ $languageCode ] ) ) { 75 $reason = $wgTranslateBlacklist[ $check ][ $languageCode ]; data (2 usages found) group-yaml-schema.yaml (2 usages found) 109 whitelist: 113 blacklist: ffs (13 usages found) PremadeMediawikiExtensionGroups.php (6 usages found) 171 'whitelist' => [], 172 'blacklist' => [], 179 $conf['LANGUAGES']['whitelist'][] = $tag; 181 $conf['LANGUAGES']['blacklist'][] = $tag; 183 $conf['LANGUAGES']['blacklist'] = '*'; 184 $conf['LANGUAGES']['whitelist'][] = $tag; SimpleFFS.php (7 usages found) 320 * Remove blacklisted authors. 327 global $wgTranslateAuthorBlacklist; 333 $blacklisted = false; 334 foreach ( $wgTranslateAuthorBlacklist as $rule ) { 339 $blacklisted = false; 342 $blacklisted = true; 347 if ( $blacklisted ) { i18n (4 usages found) core (4 usages found) en.json (2 usages found) 299 "right-translate-sandboxaction": "Execute actions whitelisted for sandboxed users", 300 "action-translate-sandboxaction": "execute actions whitelisted for sandboxed users", qqq.json (2 usages found) 60 "translate-page-disabled": "Parameters:\n* $1 - reason that the language has been blacklisted", 61 "translate-language-disabled": "Shown when someone requests a blacklisted language. [{{FULLURL:Special:Translate|group=mediawiki&language=zh-tw}} Example].", messagegroups (26 usages found) MessageGroup.php (2 usages found) 166 * Get all the translatable languages for a group, considering the whitelisting 167 * and blacklisting. MessageGroupBase.php (22 usages found) 318 * Get all the translatable languages for a group, considering the whitelisting 319 * and blacklisting. 323 global $wgTranslateBlacklist; 334 if ( isset( $lists['blacklist'] ) ) { 335 $blacklist = $lists['blacklist']; 336 if ( $blacklist === '*' ) { 337 // All languages blacklisted 339 } elseif ( is_array( $blacklist ) ) { 340 foreach ( $blacklist as $code ) { 345 // Treat lack of explicit blacklist the same as blacklisting everything. This way, 346 // when one defines only whitelist, it means that only those languages are allowed. 350 // DWIM with $wgTranslateBlacklist, e.g. languages in that list should not unexpectedly 351 // be enabled when a whitelist is used to whitelist any language. 354 if ( isset( $wgTranslateBlacklist[ $check ] ) ) { 355 foreach ( array_keys( $wgTranslateBlacklist[ $check ] ) as $blacklistedCode ) { 356 unset( $codes[ $blacklistedCode ] ); 361 if ( isset( $lists['whitelist'] ) ) { 362 $whitelist = $lists['whitelist']; 363 if ( $whitelist === '*' ) { 364 // All languages whitelisted (except $wgTranslateBlacklist) 366 } elseif ( is_array( $whitelist ) ) { 367 foreach ( $whitelist as $code ) { MessageGroupOld.php (2 usages found) 327 * Get all the translatable languages for a group, considering the whitelisting 328 * and blacklisting. specials (10 usages found) SpecialLanguageStats.php (2 usages found) 459 * is blacklisted or hidden by filters. 470 if ( $this->table->isBlacklisted( $groupId, $this->target ) !== null ) { SpecialMessageGroupStats.php (1 usage found) 149 if ( $table->isBlacklisted( $this->target, $code ) !== null ) { SpecialSupportedLanguages.php (7 usages found) 35 'TranslateAuthorBlacklist', 203 $blacklist = $this->options->get( 'TranslateAuthorBlacklist' ); 210 $blacklisted = false; 211 foreach ( $blacklist as $rule ) { 216 $blacklisted = false; 219 $blacklisted = true; 224 if ( $blacklisted ) { src (8 usages found) Synchronization (4 usages found) ExportTranslationsMaintenanceScript.php (4 usages found) 193 $whitelist = $group->getTranslatableLanguages(); 204 // Do not export languages that are blacklisted (or not whitelisted). 205 // Also check that whitelist is not null, which means that all 207 if ( is_array( $whitelist ) && !isset( $whitelist[$lang] ) ) { Validation (4 usages found) ValidationRunner.php (4 usages found) 204 global $wgTranslateCheckBlacklist; 206 if ( $wgTranslateCheckBlacklist === false ) { 212 $wgTranslateCheckBlacklist, 213 'checkBlacklist' tag (3 usages found) PageTranslationHooks.php (3 usages found) 977 // And finally check whether the language is not included in whitelist 1006 $whitelist = [ 1011 if ( in_array( $action, $whitelist ) ) { tests (21 usages found) phpunit (21 usages found) data (2 usages found) check-blacklist.php (1 usage found) 3 $checkBlacklist = [ messageindexdata.ser (1 usage found) 1 fcnz-oynpxyvfg";a:4:{i:0;s:17:"ext-spamblacklist";i:1;R:801;i:2;R:3237;i:3;R:3238;}s:16:"8:fcnz-juvgryvfg";a:4:{i:0;R:4329;i:1;R:801;i:2;R:3237;i:3 ffs (2 usages found) MediaWikiExtensionsTest.php (2 usages found) 37 $this->assertArrayHasKey( 'foo', $languages, 'Whitelisted language is available' ); 38 $this->assertArrayNotHasKey( 'bar', $languages, 'Blacklisted language is not available' ); Validation (6 usages found) ValidationRunnerTest.php (6 usages found) 33 $this->setMwGlobals( 'wgTranslateCheckBlacklist', false ); 171 'wgTranslateCheckBlacklist' => __DIR__ . '/../data/check-blacklist.php' 188 'warnings or errors are filtered as per check-blacklist.' 195 'warnings or errors are filtered as per check-blacklist only for specific language code.' 202 'warnings or errors are filtered as per check-blacklist.' 209 'warnings or errors are filtered as per check-blacklist only for specific language code.' BlackListTest.php (11 usages found) 10 * Unit tests for blacklisting/whitelisting languages for a message group 12 class BlackListTest extends MediaWikiTestCase { 46 public function testAllBlackList() { 49 'blacklist' => '*', 56 public function testAllWhiteList() { 59 'whitelist' => '*', 66 public function testWhiteListOverrideBlackList() { 69 'whitelist' => [ 'en', 'hi', 'ta' ], 70 'blacklist' => [ 'ta' ], 78 public function testSomeBlackList() { 81 'blacklist' => [ 'or', 'hi' ], utils (12 usages found) StatsTable.php (9 usages found) 260 public function isBlacklisted( $groupId, $code ) { 261 global $wgTranslateBlacklist; 263 $blacklisted = null; 272 if ( isset( $wgTranslateBlacklist[$check] ) && isset( $wgTranslateBlacklist[$check][$code] ) ) { 273 $blacklisted = $wgTranslateBlacklist[$check][$code]; 276 if ( $blacklisted !== null ) { 284 $blacklisted = true; 289 $blacklisted = true; 292 return $blacklisted; TranslateSandbox.php (3 usages found) 316 * Whitelisting for certain API modules. See also enforcePermissions. 324 $whitelist = [ 333 if ( $module->isWriteMode() && !in_array( $class, $whitelist, true ) ) { extension.json (6 usages found) 921 "TranslateBlacklist": { 923 parsed as wikitext.\n\nExample:\n'TranslateBlacklist': { '*': { 'en': 'English is the source language.' }, 'core': { 'mul': 'Not a real language.' }, 'ext 926 "TranslateCheckBlacklist": { 928 "description": "File containing checks that are to be skipped. See https://gerrit.wikimedia.org/g/translatewiki/+/master/groups/check-blacklist.php for example.\nSince 2012-10-15.", 931 "TranslateAuthorBlacklist": { 933 : "Two-dimensional array of rules that blacklists certain authors from appearing in the exports. This is useful for keeping bots and people doing maintenance HISTORY (7 usages found) 112 - Improved hiding of blacklisted groups on Special:LanguageStats. 117 - Allow black listing and white listing of languages in YAML configuration. YAML 119 optional subsections whitelist and blacklist, which take an array of language 120 codes. If a subsection is not specified, the white/blacklist value will 121 default to *, meaning all known languages. Whitelist overrides blacklist. 716 * $wgTranslateBlacklist added to prevent edits to certain language/group combinations 721 * added $wgTranslateAuthorBlacklist MessageGroups.php (2 usages found) 848 $whitelist = $group->getTranslatableLanguages(); 849 if ( is_array( $whitelist ) && !isset( $whitelist[$language] ) ) { TranslateEditAddons.php (3 usages found) 47 global $wgTranslateBlacklist; 78 if ( isset( $wgTranslateBlacklist[$check][$langCode] ) ) { 79 $reason = $wgTranslateBlacklist[$check][$langCode];