Moved language-related command-line scripts to their own directory.
[lhc/web/wiklou.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 if ( !preg_match( '/Messages(.*)\.php$/', $base, $m ) ) {
12 continue;
13 }
14 $code = str_replace( '_', '-', strtolower( $m[1] ) );
15 print "$code ";
16 $lang = Language::factory( $code );
17 $prefs = $lang->getDatePreferences();
18 if ( !$prefs ) {
19 $prefs = array( 'default' );
20 }
21 print "date: ";
22 foreach ( $prefs as $index => $pref ) {
23 if ( $index > 0 ) {
24 print ' | ';
25 }
26 print $lang->date( $ts, false, $pref );
27 }
28 print "\n$code time: ";
29 foreach ( $prefs as $index => $pref ) {
30 if ( $index > 0 ) {
31 print ' | ';
32 }
33 print $lang->time( $ts, false, $pref );
34 }
35 print "\n$code both: ";
36 foreach ( $prefs as $index => $pref ) {
37 if ( $index > 0 ) {
38 print ' | ';
39 }
40 print $lang->timeanddate( $ts, false, $pref );
41 }
42 print "\n\n";
43 }
44
45 ?>