Page MenuHomePhabricator
Authored By
mszabo
Jan 28 2025, 10:17 PM
Size
817 B
Referenced Files
None
Subscribers
None

brokenLangs.php

<?php
require_once __DIR__ . '/Maintenance.php';
class BrokenLangs extends Maintenance {
public function execute() {
$languageFactory = $this->getServiceContainer()->getLanguageFactory();
$opts = ArrayUtils::cartesianProduct(
[ 'time', 'date', 'monthonly', 'both', 'pretty' ],
[ 'mdy', 'dmy', 'ymd', 'ISO 8601', 'default' ]
);
$count = 0;
foreach ( array_keys( MediaWiki\Languages\Data\Names::NAMES ) as $code ) {
$lang = $languageFactory->getLanguage( $code );
foreach ( $opts as [ $type, $pref ] ) {
$str = $lang->getDateFormatString( $type, $pref );
if ( $str === null ) {
$this->output( "$code: $type $pref is broken\n" );
$count++;
}
}
}
$this->output( "Total broken: $count\n" );
}
}
$maintClass = BrokenLangs::class;
require RUN_MAINTENANCE_IF_MAIN;

File Metadata

Mime Type
text/x-php
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
19193953
Default Alt Text
brokenLangs.php (817 B)

Event Timeline