541c6de8f3acb0b4fbd22c3d43bd6ccda93bf485
[lhc/web/wiklou.git] / languages / classes / LanguageWa.php
1 <?php
2 /**
3 * Walloon (Walon)
4 *
5 * @package MediaWiki
6 * @subpackage Language
7 */
8
9 # NOTE: cweri après "NOTE:" po des racsegnes so des ratournaedjes
10 # k' i gn a.
11
12 class LanguageWa extends Language {
13 ###
14 ### Dates in Walloon are "1î d' <monthname>" for 1st of the month,
15 ### "<day> di <monthname>" for months starting by a consoun, and
16 ### "<day> d' <monthname>" for months starting with a vowel
17 ###
18 function date( $ts, $adj = false, $format = true, $tc = false ) {
19 global $wgUser;
20
21 if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
22 $datePreference = $this->dateFormat( $format );
23
24 # ISO (YYYY-mm-dd) format
25 #
26 # we also output this format for YMD (eg: 2001 January 15)
27 if ( $datePreference == 'ISO 8601' ) {
28 $d = substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
29 return $d;
30 }
31
32 # dd/mm/YYYY format
33 if ( $datePreference == 'walloon short' ) {
34 $d = substr($ts, 6, 2). '/' . substr($ts, 4, 2). '/' .substr($ts, 0, 4);
35 return $d;
36 }
37
38 # Walloon format
39 #
40 # we output this in all other cases
41 $m = substr( $ts, 4, 2 );
42 $n = substr( $ts, 6, 2 );
43 if ($n == 1) {
44 $d = "1î d' " . $this->getMonthName( $m ) .
45 " " . substr( $ts, 0, 4 );
46 } else if ($n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23) {
47 $d = (0 + $n) . " d' " . $this->getMonthName( $m ) .
48 " " . substr( $ts, 0, 4 );
49 } else if ($m == 4 || $m == 8 || $m == 10) {
50 $d = (0 + $n) . " d' " . $this->getMonthName( $m ) .
51 " " . substr( $ts, 0, 4 );
52 } else {
53 $d = (0 + $n) . " di " . $this->getMonthName( $m ) .
54 " " . substr( $ts, 0, 4 );
55 }
56 return $d;
57 }
58
59 function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
60 if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
61 $datePreference = $this->dateFormat( $format );
62 if ( $datePreference == 'ISO 8601' ) {
63 return parent::timeanddate( $ts, $adj, $format, $tc );
64 } else {
65 return $this->date( $ts, $adj, $format, $tc ) . ' a ' .
66 $this->time( $ts, $adj, $format, $tc );
67 }
68 }
69 }
70
71 ?>