]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - maintenance/language/date-formats.php
MediaWiki 1.11.0
[autoinstallsdev/mediawiki.git] / maintenance / language / date-formats.php
1 <?php
2
3 $ts = '20010115123456';
4
5         
6 $IP = dirname( __FILE__ ) . '/../..';
7 require_once( "$IP/maintenance/commandLine.inc" );
8
9 foreach ( glob( "$IP/languages/messages/Messages*.php" ) as $filename ) {
10         $base = basename( $filename );
11         $m = array();
12         if ( !preg_match( '/Messages(.*)\.php$/', $base, $m ) ) {
13                 continue;
14         }
15         $code = str_replace( '_', '-', strtolower( $m[1] ) );
16         print "$code ";
17         $lang = Language::factory( $code );
18         $prefs = $lang->getDatePreferences();
19         if ( !$prefs ) {
20                 $prefs = array( 'default' );
21         }
22         print "date: ";
23         foreach ( $prefs as $index => $pref ) {
24                 if ( $index > 0 ) {
25                         print ' | ';
26                 }
27                 print $lang->date( $ts, false, $pref );
28         }
29         print "\n$code time: ";
30         foreach ( $prefs as $index => $pref ) {
31                 if ( $index > 0 ) {
32                         print ' | ';
33                 }
34                 print $lang->time( $ts, false, $pref );
35         }
36         print "\n$code both: "; 
37         foreach ( $prefs as $index => $pref ) {
38                 if ( $index > 0 ) {
39                         print ' | ';
40                 }
41                 print $lang->timeanddate( $ts, false, $pref );
42         }
43         print "\n\n";
44 }
45
46