summaryrefslogtreecommitdiff
path: root/maintenance/language/date-formats.php
blob: a0d46f027839dfc5842c07ed752f64c8a79531f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php

$ts = '20010115123456';

	
$IP = dirname( __FILE__ ) . '/../..';
require_once( "$IP/maintenance/commandLine.inc" );

foreach ( glob( "$IP/languages/messages/Messages*.php" ) as $filename ) {
	$base = basename( $filename );
	$m = array();
	if ( !preg_match( '/Messages(.*)\.php$/', $base, $m ) ) {
		continue;
	}
	$code = str_replace( '_', '-', strtolower( $m[1] ) );
	print "$code ";
	$lang = Language::factory( $code );
	$prefs = $lang->getDatePreferences();
	if ( !$prefs ) {
		$prefs = array( 'default' );
	}
	print "date: ";
	foreach ( $prefs as $index => $pref ) {
		if ( $index > 0 ) {
			print ' | ';
		}
		print $lang->date( $ts, false, $pref );
	}
	print "\n$code time: ";
	foreach ( $prefs as $index => $pref ) {
		if ( $index > 0 ) {
			print ' | ';
		}
		print $lang->time( $ts, false, $pref );
	}
	print "\n$code both: "; 
	foreach ( $prefs as $index => $pref ) {
		if ( $index > 0 ) {
			print ' | ';
		}
		print $lang->timeanddate( $ts, false, $pref );
	}
	print "\n\n";
}

?>