MediaWiki
REL1_20
|
00001 <?php 00032 class LanguageWa extends Language { 00041 function convertPlural( $count, $forms ) { 00042 if ( !count( $forms ) ) { return ''; } 00043 $forms = $this->preConvertPlural( $forms, 2 ); 00044 00045 return ( $count <= 1 ) ? $forms[0] : $forms[1]; 00046 } 00047 00059 function date( $ts, $adj = false, $format = true, $tc = false ) { 00060 $ts = wfTimestamp( TS_MW, $ts ); 00061 if ( $adj ) { 00062 $ts = $this->userAdjust( $ts, $tc ); 00063 } 00064 $datePreference = $this->dateFormat( $format ); 00065 00066 # ISO (YYYY-mm-dd) format 00067 # 00068 # we also output this format for YMD (eg: 2001 January 15) 00069 if ( $datePreference == 'ISO 8601' ) { 00070 $d = substr( $ts, 0, 4 ) . '-' . substr( $ts, 4, 2 ) . '-' . substr( $ts, 6, 2 ); 00071 return $d; 00072 } 00073 00074 # dd/mm/YYYY format 00075 if ( $datePreference == 'walloon short' ) { 00076 $d = substr( $ts, 6, 2 ) . '/' . substr( $ts, 4, 2 ) . '/' . substr( $ts, 0, 4 ); 00077 return $d; 00078 } 00079 00080 # Walloon format 00081 # 00082 # we output this in all other cases 00083 $m = substr( $ts, 4, 2 ); 00084 $n = substr( $ts, 6, 2 ); 00085 if ( $n == 1 ) { 00086 $d = "1î d' " . $this->getMonthName( $m ) . 00087 " " . substr( $ts, 0, 4 ); 00088 } elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) { 00089 $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) . 00090 " " . substr( $ts, 0, 4 ); 00091 } elseif ( $m == 4 || $m == 8 || $m == 10 ) { 00092 $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) . 00093 " " . substr( $ts, 0, 4 ); 00094 } else { 00095 $d = ( 0 + $n ) . " di " . $this->getMonthName( $m ) . 00096 " " . substr( $ts, 0, 4 ); 00097 } 00098 return $d; 00099 } 00100 00108 function timeanddate( $ts, $adj = false, $format = true, $tc = false ) { 00109 if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); } 00110 $datePreference = $this->dateFormat( $format ); 00111 if ( $datePreference == 'ISO 8601' ) { 00112 return parent::timeanddate( $ts, $adj, $format, $tc ); 00113 } else { 00114 return $this->date( $ts, $adj, $format, $tc ) . ' a ' . 00115 $this->time( $ts, $adj, $format, $tc ); 00116 } 00117 } 00118 }