Of the 304 Wikipedias there are 63 that define a "[Pp]opup" gadget, of which 29 define a gadget named something other than "Navigation_popups". Generating the entry for InitialiseSettings.php is simple enough.
Last active
May 3, 2017 18:02
-
-
Save phuedx/8dd383e9b444270df6d068564aad9412 to your computer and use it in GitHub Desktop.
Go Go Gadget Gadgets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"af": "popups", | |
"as": "Navigation_popups", | |
"av": "popups", | |
"az": "popups", | |
"azb": "popups", | |
"be": "popups", | |
"bg": "Navigation_popups", | |
"bh": "Navigation_popups", | |
"bn": "Navigation_popups", | |
"br": "Popups", | |
"bs": "Navigation_popups", | |
"ca": "Navigation_popups", | |
"da": "Popups", | |
"de": "navigation-popups", | |
"el": "popupdelay", | |
"en": "Navigation_popups", | |
"eo": "Popups", | |
"es": "Navigation_popups ", | |
"fa": "popups", | |
"fi": "popups", | |
"fr": "Popups ", | |
"gag": "popups", | |
"gl": "Navigation_popups", | |
"gom": "Navigation_popups", | |
"he": "popup", | |
"hi": "Navigation_popups", | |
"id": "NavPopups", | |
"ilo": "Navigation_popups", | |
"ja": "Navigation_popups", | |
"ka": "Navigation_popups", | |
"kk": "Navigation_popups", | |
"kn": "Navigation_popups", | |
"ko": "Navigation_popups", | |
"min": "NavPopups", | |
"mr": "Navigation_popups", | |
"ms": "Navigation_popups", | |
"mzn": "popups", | |
"nl": "Navigatie popups", | |
"oc": "Popups", | |
"or": "Navigation_popups", | |
"pl": "Navigation popups ", | |
"pnb": "Navigation_popups", | |
"ps": "Navigation_popups", | |
"pt": "Navigation_popups", | |
"ro": "popups", | |
"ru": "popups", | |
"simple": "Navigation_popups-API", | |
"sq": "Navigation_popups", | |
"sr": "Popups", | |
"ta": "Navigation_popups", | |
"tcy": "Navigation_popups", | |
"test": "Navigation_popups", | |
"test2": "Navigation_popups", | |
"te": "Navigation_popups", | |
"tg": "popups", | |
"th": "Navigation_popups", | |
"tl": "Navigation_popups", | |
"tr": "Navigation_popups", | |
"ur": "Navigation_popups", | |
"vec": "Popup", | |
"yi": "NavigationPopups", | |
"zh": "Navigation_popups" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$wikipediasDblist = $_SERVER['argv'][1]; | |
$wikipedias = file( $wikipediasDblist, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES ); | |
$wikipediasLength = count( $wikipedias ); | |
$result = []; | |
foreach ( $wikipedias as $i => $wikipedia ) { | |
$lang = str_replace( 'wiki', '', $wikipedia ); | |
// Silently ignore 404s, say. | |
$response = @file_get_contents( "https://${lang}.wikipedia.org/wiki/MediaWiki:Gadgets-definition?action=raw" ); | |
$matches = []; | |
preg_match( '/\* (.*[Pp]opup.*)\[/', $response, $matches ); | |
if ( $matches ) { | |
$result[ $wikipedia ] = $matches[1]; | |
} | |
echo "${i} of ${wikipediasLength} done...\n"; | |
} | |
file_put_contents( | |
'go_go_gadget.json', | |
json_encode( $result, JSON_PRETTY_PRINT ) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"af": "popups", | |
"av": "popups", | |
"az": "popups", | |
"azb": "popups", | |
"be": "popups", | |
"br": "Popups", | |
"da": "Popups", | |
"de": "navigation-popups", | |
"el": "popupdelay", | |
"eo": "Popups", | |
"es": "Navigation_popups ", | |
"fa": "popups", | |
"fi": "popups", | |
"fr": "Popups ", | |
"gag": "popups", | |
"he": "popup", | |
"id": "NavPopups", | |
"min": "NavPopups", | |
"mzn": "popups", | |
"nl": "Navigatie popups", | |
"oc": "Popups", | |
"pl": "Navigation popups ", | |
"ro": "popups", | |
"ru": "popups", | |
"simple": "Navigation_popups-API", | |
"sr": "Popups", | |
"tg": "popups", | |
"vec": "Popup", | |
"yi": "NavigationPopups" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$wikipediaToGadgetMap = json_decode( file_get_contents( 'go_go_gadget.json' ) ); | |
$result = <<<EOF | |
<?php | |
// Generated by go_go_gadget_export.php. | |
'wgPopupsConflictingNavPopupsGadgetName' => [ | |
EOF; | |
foreach ( $wikipediaToGadgetMap as $wikipedia => $gadget ) { | |
if ( $gadget !== 'Navigation_popups' ) { | |
$result .= "\t '${wikipedia}' => '${gadget}',\n"; | |
} | |
} | |
$result .= "],\n"; | |
file_put_contents( 'InitialiseSettings.php', $result ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Generated by go_go_gadget_export.php. | |
'wgPopupsConflictingNavPopupsGadgetName' => [ | |
'af' => 'popups', | |
'av' => 'popups', | |
'az' => 'popups', | |
'azb' => 'popups', | |
'be' => 'popups', | |
'br' => 'Popups', | |
'da' => 'Popups', | |
'de' => 'navigation-popups', | |
'el' => 'popupdelay', | |
'eo' => 'Popups', | |
'es' => 'Navigation_popups ', | |
'fa' => 'popups', | |
'fi' => 'popups', | |
'fr' => 'Popups ', | |
'gag' => 'popups', | |
'he' => 'popup', | |
'id' => 'NavPopups', | |
'min' => 'NavPopups', | |
'mzn' => 'popups', | |
'nl' => 'Navigatie popups', | |
'oc' => 'Popups', | |
'pl' => 'Navigation popups ', | |
'ro' => 'popups', | |
'ru' => 'popups', | |
'simple' => 'Navigation_popups-API', | |
'sr' => 'Popups', | |
'tg' => 'popups', | |
'vec' => 'Popup', | |
'yi' => 'NavigationPopups', | |
], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the record : https://phabricator.wikimedia.org/T164044
wiki suffix is missing.