MediaWiki
REL1_19
|
00001 <?php 00008 # NOTE: cweri après "NOTE:" po des racsegnes so des ratournaedjes 00009 # k' i gn a. 00010 00011 class LanguageWa extends Language { 00020 function convertPlural( $count, $forms ) { 00021 if ( !count( $forms ) ) { return ''; } 00022 $forms = $this->preConvertPlural( $forms, 2 ); 00023 00024 return ( $count <= 1 ) ? $forms[0] : $forms[1]; 00025 } 00026 00038 function date( $ts, $adj = false, $format = true, $tc = false ) { 00039 $ts = wfTimestamp( TS_MW, $ts ); 00040 if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); } 00041 $datePreference = $this->dateFormat( $format ); 00042 00043 # ISO (YYYY-mm-dd) format 00044 # 00045 # we also output this format for YMD (eg: 2001 January 15) 00046 if ( $datePreference == 'ISO 8601' ) { 00047 $d = substr( $ts, 0, 4 ) . '-' . substr( $ts, 4, 2 ) . '-' . substr( $ts, 6, 2 ); 00048 return $d; 00049 } 00050 00051 # dd/mm/YYYY format 00052 if ( $datePreference == 'walloon short' ) { 00053 $d = substr( $ts, 6, 2 ) . '/' . substr( $ts, 4, 2 ) . '/' . substr( $ts, 0, 4 ); 00054 return $d; 00055 } 00056 00057 # Walloon format 00058 # 00059 # we output this in all other cases 00060 $m = substr( $ts, 4, 2 ); 00061 $n = substr( $ts, 6, 2 ); 00062 if ( $n == 1 ) { 00063 $d = "1î d' " . $this->getMonthName( $m ) . 00064 " " . substr( $ts, 0, 4 ); 00065 } elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) { 00066 $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) . 00067 " " . substr( $ts, 0, 4 ); 00068 } elseif ( $m == 4 || $m == 8 || $m == 10 ) { 00069 $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) . 00070 " " . substr( $ts, 0, 4 ); 00071 } else { 00072 $d = ( 0 + $n ) . " di " . $this->getMonthName( $m ) . 00073 " " . substr( $ts, 0, 4 ); 00074 } 00075 return $d; 00076 } 00077 00085 function timeanddate( $ts, $adj = false, $format = true, $tc = false ) { 00086 if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); } 00087 $datePreference = $this->dateFormat( $format ); 00088 if ( $datePreference == 'ISO 8601' ) { 00089 return parent::timeanddate( $ts, $adj, $format, $tc ); 00090 } else { 00091 return $this->date( $ts, $adj, $format, $tc ) . ' a ' . 00092 $this->time( $ts, $adj, $format, $tc ); 00093 } 00094 } 00095 }