* Restructured
[lhc/web/wiklou.git] / languages / LanguageWa.php
1 <?php
2 /**
3 * Walloon (Walon)
4 *
5 * @package MediaWiki
6 * @subpackage Language
7 */
8
9 require_once( "LanguageUtf8.php" );
10
11 if (!$wgCachedMessageArrays) {
12 require_once('MessagesWa.php');
13 }
14
15 # NOTE: cweri après "NOTE:" po des racsegnes so des ratournaedjes
16 # k' i gn a.
17
18 define( 'MW_DATE_WLN_LONG', MW_DATE_DMY );
19 define( 'MW_DATE_WLN_SHORT', '4' );
20
21 class LanguageWa extends LanguageUtf8 {
22 private $mMessagesWa, $mNamespaceNamesWa = null;
23
24 private $mQuickbarSettingsWa = array(
25 "Nole bår", "Aclawêye a hintche", "Aclawêye a droete", "Flotante a hintche", "Flotante a droete"
26 );
27
28 # lists "no preferences", normall (long) walloon date,
29 # short walloon date, and ISO format
30 # MW_DATE_DMY is alias for long format, as it is dd mmmmm yyyy.
31 # "4" is chosen as value for short format, as it is used in LanguageVi.php
32 private $mDateFormatsWa = array(
33 MW_DATE_DEFAULT => 'Nole preferince',
34 #MW_DATE_DMY => '16:12, 15 January 2001',
35 #MW_DATE_MDY => '16:12, January 15, 2001',
36 #MW_DATE_YMD => '16:12, 2001 January 15',
37 MW_DATE_WLN_LONG => '15 di djanvî 2001 a 16:12',
38 MW_DATE_WLN_SHORT => '15/01/2001 a 16:12',
39 MW_DATE_ISO => '2001-01-15 16:12:34',
40 );
41
42
43
44 function LanguageWa() {
45 LanguageUtf8::LanguageUtf8();
46
47 global $wgAllMessagesWa;
48 $this->mMessagesWa =& $wgAllMessagesWa;
49
50 global $wgMetaNamespace;
51 $this->mNamespaceNamesWa = array(
52 NS_MEDIA => "Media", /* Media */
53 NS_SPECIAL => "Sipeciås", /* Special */
54 NS_MAIN => "",
55 NS_TALK => "Copene", /* Talk */
56 NS_USER => "Uzeu", /* User */
57 NS_USER_TALK => "Uzeu_copene", /* User_talk */
58 NS_PROJECT => $wgMetaNamespace,
59 NS_PROJECT_TALK => $wgMetaNamespace . "_copene",
60 NS_IMAGE => "Imådje", /* Image */
61 NS_IMAGE_TALK => "Imådje_copene", /* Image_talk */
62 NS_MEDIAWIKI => "MediaWiki", /* MediaWiki */
63 NS_MEDIAWIKI_TALK => "MediaWiki_copene", /* MediaWiki_talk */
64 NS_TEMPLATE => "Modele",
65 NS_TEMPLATE_TALK => "Modele_copene",
66 NS_HELP => "Aidance",
67 NS_HELP_TALK => "Aidance_copene",
68 NS_CATEGORY => "Categoreye",
69 NS_CATEGORY_TALK => "Categoreye_copene",
70 );
71 }
72
73 function getNamespaces() {
74 return $this->mNamespaceNamesWa + parent::getNamespaces();
75 }
76
77 function getQuickbarSettings() {
78 return $this->mQuickbarSettingsWa;
79 }
80
81 function getDateFormats() {
82 return $this->mDateFormatsWa;
83 }
84
85 function getMessage( $key ) {
86 if( isset( $this->mMessagesWa[$key] ) ) {
87 return $this->mMessagesWa[$key];
88 } else {
89 return parent::getMessage( $key );
90 }
91 }
92
93 function getAllMessages() {
94 return $this->mMessagesWa;
95 }
96
97 ###
98 ### Dates in Walloon are "1î d' <monthname>" for 1st of the month,
99 ### "<day> di <monthname>" for months starting by a consoun, and
100 ### "<day> d' <monthname>" for months starting with a vowel
101 ###
102 function date( $ts, $adj = false, $format = true, $tc = false ) {
103 global $wgUser;
104
105 if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
106 $datePreference = $this->dateFormat( $format );
107
108 # ISO (YYYY-mm-dd) format
109 #
110 # we also output this format for YMD (eg: 2001 January 15)
111 if ( $datePreference == MW_DATE_ISO ||
112 $datePreference == MW_DATE_YMD ) {
113 $d = substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
114 return $d;
115 }
116
117 # dd/mm/YYYY format
118 if ( $datePreference == MW_DATE_WLN_SHORT ) {
119 $d = substr($ts, 6, 2). '/' . substr($ts, 4, 2). '/' .substr($ts, 0, 4);
120 return $d;
121 }
122
123 # Walloon format
124 #
125 # we output this in all other cases
126 $m = substr( $ts, 4, 2 );
127 $n = substr( $ts, 6, 2 );
128 if ($n == 1) {
129 $d = "1î d' " . $this->getMonthName( $m ) .
130 " " . substr( $ts, 0, 4 );
131 } else if ($n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23) {
132 $d = (0 + $n) . " d' " . $this->getMonthName( $m ) .
133 " " . substr( $ts, 0, 4 );
134 } else if ($m == 4 || $m == 8 || $m == 10) {
135 $d = (0 + $n) . " d' " . $this->getMonthName( $m ) .
136 " " . substr( $ts, 0, 4 );
137 } else {
138 $d = (0 + $n) . " di " . $this->getMonthName( $m ) .
139 " " . substr( $ts, 0, 4 );
140 }
141 return $d;
142 }
143
144 function timeBeforeDate( ) {
145 return false;
146 }
147
148 function timeDateSeparator( $format ) {
149 return " a ";
150 }
151
152 # definixha del cogne po les limeros
153 # (number format definition)
154 # en: 12,345.67 -> wa: 12 345,67
155 function separatorTransformTable() {
156 return array(',' => "\xc2\xa0", '.' => ',' );
157 }
158
159 function linkTrail() {
160 return '/^([a-zåâêîôûçéè]+)(.*)$/sDu';
161 }
162
163 }
164
165 ?>