Added result properties to action=paraminfo
[lhc/web/wiklou.git] / languages / classes / LanguageWa.php
1 <?php
2 /**
3 * Walloon (Walon)
4 *
5 * @ingroup Language
6 */
7
8 # NOTE: cweri après "NOTE:" po des racsegnes so des ratournaedjes
9 # k' i gn a.
10
11 class LanguageWa extends Language {
12 /**
13 * Use singular form for zero
14 *
15 * @param $count int
16 * @param $forms array
17 *
18 * @return string
19 */
20 function convertPlural( $count, $forms ) {
21 if ( !count( $forms ) ) { return ''; }
22 $forms = $this->preConvertPlural( $forms, 2 );
23
24 return ( $count <= 1 ) ? $forms[0] : $forms[1];
25 }
26
27 /**
28 * Dates in Walloon are "1î d' <monthname>" for 1st of the month,
29 * "<day> di <monthname>" for months starting by a consoun, and
30 * "<day> d' <monthname>" for months starting with a vowel
31 *
32 * @param $ts string
33 * @param $adj bool
34 * @param $format bool
35 * @param $tc bool
36 * @return string
37 */
38 function date( $ts, $adj = false, $format = true, $tc = false ) {
39 $ts = wfTimestamp( TS_MW, $ts );
40 if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
41 $datePreference = $this->dateFormat( $format );
42
43 # ISO (YYYY-mm-dd) format
44 #
45 # we also output this format for YMD (eg: 2001 January 15)
46 if ( $datePreference == 'ISO 8601' ) {
47 $d = substr( $ts, 0, 4 ) . '-' . substr( $ts, 4, 2 ) . '-' . substr( $ts, 6, 2 );
48 return $d;
49 }
50
51 # dd/mm/YYYY format
52 if ( $datePreference == 'walloon short' ) {
53 $d = substr( $ts, 6, 2 ) . '/' . substr( $ts, 4, 2 ) . '/' . substr( $ts, 0, 4 );
54 return $d;
55 }
56
57 # Walloon format
58 #
59 # we output this in all other cases
60 $m = substr( $ts, 4, 2 );
61 $n = substr( $ts, 6, 2 );
62 if ( $n == 1 ) {
63 $d = "1î d' " . $this->getMonthName( $m ) .
64 " " . substr( $ts, 0, 4 );
65 } elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
66 $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
67 " " . substr( $ts, 0, 4 );
68 } elseif ( $m == 4 || $m == 8 || $m == 10 ) {
69 $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
70 " " . substr( $ts, 0, 4 );
71 } else {
72 $d = ( 0 + $n ) . " di " . $this->getMonthName( $m ) .
73 " " . substr( $ts, 0, 4 );
74 }
75 return $d;
76 }
77
78 /**
79 * @param $ts string
80 * @param $adj bool
81 * @param $format bool
82 * @param $tc bool
83 * @return string
84 */
85 function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
86 if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
87 $datePreference = $this->dateFormat( $format );
88 if ( $datePreference == 'ISO 8601' ) {
89 return parent::timeanddate( $ts, $adj, $format, $tc );
90 } else {
91 return $this->date( $ts, $adj, $format, $tc ) . ' a ' .
92 $this->time( $ts, $adj, $format, $tc );
93 }
94 }
95 }